<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <title>Generic Sensor API</title>
  <meta content="ED" name="w3c-status">
<style data-fill-with="stylesheet">/******************************************************************************
 *                   Style sheet for the W3C specifications                   *
 *
 * Special classes handled by this style sheet include:
 *
 * Indices
 *   - .toc for the Table of Contents (<ol class="toc">)
 *     + <span class="secno"> for the section numbers
 *   - #toc for the Table of Contents (<nav id="toc">)
 *   - ul.index for Indices (<a href="#ref">term</a><span>, in §N.M</span>)
 *   - table.index for Index Tables (e.g. for properties or elements)
 *
 * Structural Markup
 *   - table.data for general data tables
 *     -> use 'scope' attribute, <colgroup>, <thead>, and <tbody> for best results !
 *     -> use <table class='complex data'> for extra-complex tables
 *     -> use <td class='long'> for paragraph-length cell content
 *     -> use <td class='pre'> when manual line breaks/indentation would help readability
 *   - dl.switch for switch statements
 *   - ol.algorithm for algorithms (helps to visualize nesting)
 *   - .figure and .caption (HTML4) and figure and figcaption (HTML5)
 *     -> .sidefigure for right-floated figures
 *   - ins/del
 *
 * Code
 *   - pre and code
 *
 * Special Sections
 *   - .note       for informative notes             (div, p, span, aside, details)
 *   - .example    for informative examples          (div, p, pre, span)
 *   - .issue      for issues                        (div, p, span)
 *   - .assertion  for assertions                    (div, p, span)
 *   - .advisement for loud normative statements     (div, p, strong)
 *   - .annoying-warning for spec obsoletion notices (div, aside, details)
 *
 * Definition Boxes
 *   - pre.def   for WebIDL definitions
 *   - table.def for tables that define other entities (e.g. CSS properties)
 *   - dl.def    for definition lists that define other entitles (e.g. HTML elements)
 *
 * Numbering
 *   - .secno for section numbers in .toc and headings (<span class='secno'>3.2</span>)
 *   - .marker for source-inserted example/figure/issue numbers (<span class='marker'>Issue 4</span>)
 *   - ::before styled for CSS-generated issue/example/figure numbers:
 *     -> Documents wishing to use this only need to add
 *        figcaption::before,
 *        .caption::before { content: "Figure "  counter(figure) " ";  }
 *        .example::before { content: "Example " counter(example) " "; }
 *        .issue::before   { content: "Issue "   counter(issue) " ";   }
 *
 * Header Stuff (ignore, just don't conflict with these classes)
 *   - .head for the header
 *   - .copyright for the copyright
 *
 * Miscellaneous
 *   - .overlarge for things that should be as wide as possible, even if
 *     that overflows the body text area. This can be used on an item or
 *     on its container, depending on the effect desired.
 *     Note that this styling basically doesn't help at all when printing,
 *     since A4 paper isn't much wider than the max-width here.
 *     It's better to design things to fit into a narrower measure if possible.
 *   - js-added ToC jump links (see fixup.js)
 *
 ******************************************************************************/

/******************************************************************************/
/*                                   Body                                     */
/******************************************************************************/

	body {
		counter-reset: example figure issue;

		/* Layout */
		max-width: 50em;               /* limit line length to 50em for readability   */
		margin: 0 auto;                /* center text within page                     */
		padding: 1.6em 1.5em 2em 50px; /* assume 16px font size for downlevel clients */
		padding: 1.6em 1.5em 2em calc(26px + 1.5em); /* leave space for status flag     */

		/* Typography */
		line-height: 1.5;
		font-family: sans-serif;
		widows: 2;
		orphans: 2;
		word-wrap: break-word;
		overflow-wrap: break-word;
		hyphens: auto;

		/* Colors */
		color: black;
		background: white top left fixed no-repeat;
		background-size: 25px auto;
	}


/******************************************************************************/
/*                         Front Matter & Navigation                          */
/******************************************************************************/

/** Header ********************************************************************/

	div.head { margin-bottom: 1em }
	div.head hr { border-style: solid; }

	div.head h1 {
		font-weight: bold;
		margin: 0 0 .1em;
		font-size: 220%;
	}

	div.head h2 { margin-bottom: 1.5em;}

/** W3C Logo ******************************************************************/

	.head .logo {
		float: right;
		margin: 0.4rem 0 0.2rem .4rem;
	}

	.head img[src*="logos/W3C"] {
		display: block;
		border: solid #1a5e9a;
		border-width: .65rem .7rem .6rem;
		border-radius: .4rem;
		background: #1a5e9a;
		color: white;
		font-weight: bold;
	}

	.head a:hover > img[src*="logos/W3C"],
	.head a:focus > img[src*="logos/W3C"] {
		opacity: .8;
	}

	.head a:active > img[src*="logos/W3C"] {
		background: #c00;
		border-color: #c00;
	}

	/* see also additional rules in Link Styling section */

/** Copyright *****************************************************************/

	p.copyright,
	p.copyright small { font-size: small }

/** Back to Top / ToC Toggle **************************************************/

	@media print {
		#toc-nav {
			display: none;
		}
	}
	@media not print {
		#toc-nav {
			position: fixed;
			z-index: 2;
			bottom: 0; left: 0;
			margin: 0;
			min-width: 1.33em;
			border-top-right-radius: 2rem;
			box-shadow: 0 0 2px;
			font-size: 1.5em;
			color: black;
		}
		#toc-nav > a {
			display: block;
			white-space: nowrap;

			height: 1.33em;
			padding: .1em 0.3em;
			margin: 0;

			background: white;
			box-shadow: 0 0 2px;
			border: none;
			border-top-right-radius: 1.33em;
			background: white;
		}
		#toc-nav > #toc-jump {
			padding-bottom: 2em;
			margin-bottom: -1.9em;
		}

		#toc-nav > a:hover,
		#toc-nav > a:focus {
			background: #f8f8f8;
		}
		#toc-nav > a:not(:hover):not(:focus) {
			color: #707070;
		}

		/* statusbar gets in the way on keyboard focus; remove once browsers fix */
		#toc-nav > a[href="#toc"]:not(:hover):focus:last-child {
			padding-bottom: 1.5rem;
		}

		#toc-nav:not(:hover) > a:not(:focus) > span + span {
			/* Ideally this uses :focus-within on #toc-nav */
			display: none;
		}
		#toc-nav > a > span + span {
			padding-right: 0.2em;
		}

		#toc-toggle-inline {
			vertical-align: 0.05em;
			font-size: 80%;
			color: gray;
			color: hsla(203,20%,40%,.7);
			border-style: none;
			background: transparent;
			position: relative;
		}
		#toc-toggle-inline:hover:not(:active),
		#toc-toggle-inline:focus:not(:active) {
			text-shadow: 1px 1px silver;
			top: -1px;
			left: -1px;
		}

		#toc-nav :active {
			color: #C00;
		}
	}

/** ToC Sidebar ***************************************************************/

	/* Floating sidebar */
	@media screen {
		body.toc-sidebar #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			max-width: 80%;
			max-width: calc(100% - 2em - 26px);
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body.toc-sidebar #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}
		body.toc-sidebar #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	/* Hide main scroller when only the ToC is visible anyway */
	@media screen and (max-width: 28em) {
		body.toc-sidebar {
			overflow: hidden;
		}
	}

	/* Sidebar with its own space */
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body:not(.toc-inline) #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}

		body:not(.toc-inline) {
			padding-left: 29em;
		}
		/* See also Overflow section at the bottom */

		body:not(.toc-inline) #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) {
			margin: 0 4em;
		}
	}

/******************************************************************************/
/*                                Sectioning                                  */
/******************************************************************************/

/** Headings ******************************************************************/

	h1, h2, h3, h4, h5, h6, dt {
		page-break-after: avoid;
		page-break-inside: avoid;
		font: 100% sans-serif;   /* Reset all font styling to clear out UA styles */
		font-family: inherit;    /* Inherit the font family. */
		line-height: 1.2;        /* Keep wrapped headings compact */
		hyphens: manual;         /* Hyphenated headings look weird */
	}

	h2, h3, h4, h5, h6 {
		margin-top: 3rem;
	}

	h1, h2, h3 {
		color: #005A9C;
		background: transparent;
	}

	h1 { font-size: 170%; }
	h2 { font-size: 140%; }
	h3 { font-size: 120%; }
	h4 { font-weight: bold; }
	h5 { font-style: italic; }
	h6 { font-variant: small-caps; }
	dt { font-weight: bold; }

/** Subheadings ***************************************************************/

	h1 + h2,
	#subtitle {
		/* #subtitle is a subtitle in an H2 under the H1 */
		margin-top: 0;
	}
	h2 + h3,
	h3 + h4,
	h4 + h5,
	h5 + h6 {
		margin-top: 1.2em; /* = 1 x line-height */
	}

/** Section divider ***********************************************************/

	:not(.head) > hr {
		font-size: 1.5em;
		text-align: center;
		margin: 1em auto;
		height: auto;
		border: transparent solid 0;
		background: transparent;
	}
	:not(.head) > hr::before {
		content: "\2727\2003\2003\2727\2003\2003\2727";
	}

/******************************************************************************/
/*                            Paragraphs and Lists                            */
/******************************************************************************/

	p {
		margin: 1em 0;
	}

	dd > p:first-child,
	li > p:first-child {
		margin-top: 0;
	}

	ul, ol {
		margin-left: 0;
		padding-left: 2em;
	}

	li {
		margin: 0.25em 0 0.5em;
		padding: 0;
	}

	dl dd {
		margin: 0 0 .5em 2em;
	}

	.head dd + dd { /* compact for header */
		margin-top: -.5em;
	}

	/* Style for algorithms */
	ol.algorithm ol:not(.algorithm),
	.algorithm > ol ol:not(.algorithm) {
	 border-left: 0.5em solid #DEF;
	}

	/* Put nice boxes around each algorithm. */
	[data-algorithm]:not(.heading) {
	  padding: .5em;
	  border: thin solid #ddd; border-radius: .5em;
	  margin: .5em calc(-0.5em - 1px);
	}
	[data-algorithm]:not(.heading) > :first-child {
	  margin-top: 0;
	}
	[data-algorithm]:not(.heading) > :last-child {
	  margin-bottom: 0;
	}

	/* Style for switch/case <dl>s */
	dl.switch > dd > ol.only,
	dl.switch > dd > .only > ol {
	 margin-left: 0;
	}
	dl.switch > dd > ol.algorithm,
	dl.switch > dd > .algorithm > ol {
	 margin-left: -2em;
	}
	dl.switch {
	 padding-left: 2em;
	}
	dl.switch > dt {
	 text-indent: -1.5em;
	 margin-top: 1em;
	}
	dl.switch > dt + dt {
	 margin-top: 0;
	}
	dl.switch > dt::before {
	 content: '\21AA';
	 padding: 0 0.5em 0 0;
	 display: inline-block;
	 width: 1em;
	 text-align: right;
	 line-height: 0.5em;
	}

/** Terminology Markup ********************************************************/


/******************************************************************************/
/*                                 Inline Markup                              */
/******************************************************************************/

/** Terminology Markup ********************************************************/
	dfn   { /* Defining instance */
		font-weight: bolder;
	}
	a > i { /* Instance of term */
		font-style: normal;
	}
	dt dfn code, code.idl {
		font-size: medium;
	}
	dfn var {
		font-style: normal;
	}

/** Change Marking ************************************************************/

	del { color: red;  text-decoration: line-through; }
	ins { color: #080; text-decoration: underline;    }

/** Miscellaneous improvements to inline formatting ***************************/

	sup {
		vertical-align: super;
		font-size: 80%
	}

/******************************************************************************/
/*                                    Code                                    */
/******************************************************************************/

/** General monospace/pre rules ***********************************************/

	pre, code, samp {
		font-family: Menlo, Consolas, "DejaVu Sans Mono", Monaco, monospace;
		font-size: .9em;
		page-break-inside: avoid;
		hyphens: none;
		text-transform: none;
	}
	pre code,
	code code {
		font-size: 100%;
	}

	pre {
		margin-top: 1em;
		margin-bottom: 1em;
		overflow: auto;
	}

/** Inline Code fragments *****************************************************/

  /* Do something nice. */

/******************************************************************************/
/*                                    Links                                   */
/******************************************************************************/

/** General Hyperlinks ********************************************************/

	/* We hyperlink a lot, so make it less intrusive */
	a[href] {
		color: #034575;
		text-decoration: none;
		border-bottom: 1px solid #707070;
		/* Need a bit of extending for it to look okay */
		padding: 0 1px 0;
		margin: 0 -1px 0;
	}
	a:visited {
		border-bottom-color: #BBB;
	}

	/* Use distinguishing colors when user is interacting with the link */
	a[href]:focus,
	a[href]:hover {
		background: #f8f8f8;
		background: rgba(75%, 75%, 75%, .25);
		border-bottom-width: 3px;
		margin-bottom: -2px;
	}
	a[href]:active {
		color: #C00;
		border-color: #C00;
	}

	/* Backout above styling for W3C logo */
	.head .logo,
	.head .logo a {
		border: none;
		text-decoration: none;
		background: transparent;
	}

/******************************************************************************/
/*                                    Images                                  */
/******************************************************************************/

	img {
		border-style: none;
	}

	/* For autogen numbers, add
	   .caption::before, figcaption::before { content: "Figure " counter(figure) ". "; }
	*/

	figure, .figure, .sidefigure {
		page-break-inside: avoid;
		text-align: center;
		margin: 2.5em 0;
	}
	.figure img,    .sidefigure img,    figure img,
	.figure object, .sidefigure object, figure object {
		max-width: 100%;
		margin: auto;
	}
	.figure pre, .sidefigure pre, figure pre {
		text-align: left;
		display: table;
		margin: 1em auto;
	}
	.figure table, figure table {
		margin: auto;
	}
	@media screen and (min-width: 20em) {
		.sidefigure {
			float: right;
			width: 50%;
			margin: 0 0 0.5em 0.5em
		}
	}
	.caption, figcaption, caption {
		font-style: italic;
		font-size: 90%;
	}
	.caption::before, figcaption::before, figcaption > .marker {
		font-weight: bold;
	}
	.caption, figcaption {
		counter-increment: figure;
	}

	/* DL list is indented 2em, but figure inside it is not */
	dd > .figure, dd > figure { margin-left: -2em }

/******************************************************************************/
/*                             Colored Boxes                                  */
/******************************************************************************/

	.issue, .note, .example, .assertion, .advisement, blockquote {
		padding: .5em;
		border: .5em;
		border-left-style: solid;
		page-break-inside: avoid;
	}
	span.issue, span.note {
		padding: .1em .5em .15em;
		border-right-style: solid;
	}

	.issue,
	.note,
	.example,
	.advisement,
	.assertion,
	blockquote {
		margin: 1em auto;
	}
	.note  > p:first-child,
	.issue > p:first-child,
	blockquote > :first-child {
		margin-top: 0;
	}
	blockquote > :last-child {
		margin-bottom: 0;
	}

/** Blockquotes ***************************************************************/

	blockquote {
		border-color: silver;
	}

/** Open issue ****************************************************************/

	.issue {
		border-color: #E05252;
		background: #FBE9E9;
		counter-increment: issue;
		overflow: auto;
	}
	.issue::before, .issue > .marker {
		text-transform: uppercase;
		color: #AE1E1E;
		padding-right: 1em;
		text-transform: uppercase;
	}
	/* Add .issue::before { content: "Issue " counter(issue) " "; } for autogen numbers,
	   or use class="marker" to mark up the issue number in source. */

/** Example *******************************************************************/

	.example {
		border-color: #E0CB52;
		background: #FCFAEE;
		counter-increment: example;
		overflow: auto;
		clear: both;
	}
	.example::before, .example > .marker {
		text-transform: uppercase;
		color: #827017;
		min-width: 7.5em;
		display: block;
	}
	/* Add .example::before { content: "Example " counter(example) " "; } for autogen numbers,
	   or use class="marker" to mark up the example number in source. */

/** Non-normative Note ********************************************************/

	.note {
		border-color: #52E052;
		background: #E9FBE9;
		overflow: auto;
	}

	.note::before, .note > .marker,
	details.note > summary::before,
	details.note > summary > .marker {
		text-transform: uppercase;
		display: block;
		color: hsl(120, 70%, 30%);
	}
	/* Add .note::before { content: "Note"; } for autogen label,
	   or use class="marker" to mark up the label in source. */

	details.note > summary {
		display: block;
		color: hsl(120, 70%, 30%);
	}
	details.note[open] > summary {
		border-bottom: 1px silver solid;
	}

/** Assertion Box *************************************************************/
	/*  for assertions in algorithms */

	.assertion {
		border-color: #AAA;
		background: #EEE;
	}

/** Advisement Box ************************************************************/
	/*  for attention-grabbing normative statements */

	.advisement {
		border-color: orange;
		border-style: none solid;
		background: #FFEECC;
	}
	strong.advisement {
		display: block;
		text-align: center;
	}
	.advisement > .marker {
		color: #B35F00;
	}

/** Spec Obsoletion Notice ****************************************************/
	/* obnoxious obsoletion notice for older/abandoned specs. */

	details {
		display: block;
	}
	summary {
		font-weight: bolder;
	}

	.annoying-warning:not(details),
	details.annoying-warning:not([open]) > summary,
	details.annoying-warning[open] {
		background: #fdd;
		color: red;
		font-weight: bold;
		padding: .75em 1em;
		border: thick red;
		border-style: solid;
		border-radius: 1em;
	}
	.annoying-warning :last-child {
		margin-bottom: 0;
	}

@media not print {
	details.annoying-warning[open] {
		position: fixed;
		left: 1em;
		right: 1em;
		bottom: 1em;
		z-index: 1000;
	}
}

	details.annoying-warning:not([open]) > summary {
		text-align: center;
	}

/** Entity Definition Boxes ***************************************************/

	.def {
		padding: .5em 1em;
		background: #DEF;
		margin: 1.2em 0;
		border-left: 0.5em solid #8CCBF2;
	}

/******************************************************************************/
/*                                    Tables                                  */
/******************************************************************************/

	th, td {
		text-align: left;
		text-align: start;
	}

/** Property/Descriptor Definition Tables *************************************/

	table.def {
		/* inherits .def box styling, see above */
		width: 100%;
		border-spacing: 0;
	}

	table.def td,
	table.def th {
		padding: 0.5em;
		vertical-align: baseline;
		border-bottom: 1px solid #bbd7e9;
	}

	table.def > tbody > tr:last-child th,
	table.def > tbody > tr:last-child td {
		border-bottom: 0;
	}

	table.def th {
		font-style: italic;
		font-weight: normal;
		padding-left: 1em;
		width: 3em;
	}

	/* For when values are extra-complex and need formatting for readability */
	table td.pre {
		white-space: pre-wrap;
	}

	/* A footnote at the bottom of a def table */
	table.def           td.footnote {
		padding-top: 0.6em;
	}
	table.def           td.footnote::before {
		content: " ";
		display: block;
		height: 0.6em;
		width: 4em;
		border-top: thin solid;
	}

/** Data tables (and properly marked-up index tables) *************************/
	/*
		 <table class="data"> highlights structural relationships in a table
		 when correct markup is used (e.g. thead/tbody, th vs. td, scope attribute)

		 Use class="complex data" for particularly complicated tables --
		 (This will draw more lines: busier, but clearer.)

		 Use class="long" on table cells with paragraph-like contents
		 (This will adjust text alignment accordingly.)
		 Alternately use class="longlastcol" on tables, to have the last column assume "long".
	*/

	table {
		word-wrap: normal;
		overflow-wrap: normal;
		hyphens: manual;
	}

	table.data,
	table.index {
		margin: 1em auto;
		border-collapse: collapse;
		border: hidden;
		width: 100%;
	}
	table.data caption,
	table.index caption {
		max-width: 50em;
		margin: 0 auto 1em;
	}

	table.data td,  table.data th,
	table.index td, table.index th {
		padding: 0.5em 1em;
		border-width: 1px;
		border-color: silver;
		border-top-style: solid;
	}

	table.data thead td:empty {
		padding: 0;
		border: 0;
	}

	table.data  thead,
	table.index thead,
	table.data  tbody,
	table.index tbody {
		border-bottom: 2px solid;
	}

	table.data colgroup,
	table.index colgroup {
		border-left: 2px solid;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		border-right: 2px solid;
		border-top: 1px solid silver;
		padding-right: 1em;
	}

	table.data th[colspan],
	table.data td[colspan] {
		text-align: center;
	}

	table.complex.data th,
	table.complex.data td {
		border: 1px solid silver;
		text-align: center;
	}

	table.data.longlastcol td:last-child,
	table.data td.long {
	 vertical-align: baseline;
	 text-align: left;
	}

	table.data img {
		vertical-align: middle;
	}


/*
Alternate table alignment rules

	table.data,
	table.index {
		text-align: center;
	}

	table.data  thead th[scope="row"],
	table.index thead th[scope="row"] {
		text-align: right;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		text-align: right;
	}

Possible extra rowspan handling

	table.data  tbody th[rowspan]:not([rowspan='1']),
	table.index tbody th[rowspan]:not([rowspan='1']),
	table.data  tbody td[rowspan]:not([rowspan='1']),
	table.index tbody td[rowspan]:not([rowspan='1']) {
		border-left: 1px solid silver;
	}

	table.data  tbody th[rowspan]:first-child,
	table.index tbody th[rowspan]:first-child,
	table.data  tbody td[rowspan]:first-child,
	table.index tbody td[rowspan]:first-child{
		border-left: 0;
		border-right: 1px solid silver;
	}
*/

/******************************************************************************/
/*                                  Indices                                   */
/******************************************************************************/


/** Table of Contents *********************************************************/

	.toc a {
		/* More spacing; use padding to make it part of the click target. */
		padding-top: 0.1rem;
		/* Larger, more consistently-sized click target */
		display: block;
		/* Reverse color scheme */
		color: black;
		border-color: #3980B5;
		border-bottom-width: 3px !important;
		margin-bottom: 0px !important;
	}
	.toc a:visited {
		border-color: #054572;
	}
	.toc a:not(:focus):not(:hover) {
		/* Allow colors to cascade through from link styling */
		border-bottom-color: transparent;
	}

	.toc, .toc ol, .toc ul, .toc li {
		list-style: none; /* Numbers must be inlined into source */
		/* because generated content isn't search/selectable and markers can't do multilevel yet */
		margin:  0;
		padding: 0;
		line-height: 1.1rem; /* consistent spacing */
	}

	/* ToC not indented until third level, but font style & margins show hierarchy */
	.toc > li             { font-weight: bold;   }
	.toc > li li          { font-weight: normal; }
	.toc > li li li       { font-size:   95%;    }
	.toc > li li li li    { font-size:   90%;    }
	.toc > li li li li .secno { font-size: 85%; }
	.toc > li li li li li { font-size:   85%;    }
	.toc > li li li li li .secno { font-size: 100%; }

	/* @supports not (display:grid) { */
		.toc > li             { margin: 1.5rem 0;    }
		.toc > li li          { margin: 0.3rem 0;    }
		.toc > li li li       { margin-left: 2rem;   }

		/* Section numbers in a column of their own */
		.toc .secno {
			float: left;
			width: 4rem;
			white-space: nowrap;
		}

		.toc li {
			clear: both;
		}

		:not(li) > .toc              { margin-left:  5rem; }
		.toc .secno                  { margin-left: -5rem; }
		.toc > li li li .secno       { margin-left: -7rem; }
		.toc > li li li li .secno    { margin-left: -9rem; }
		.toc > li li li li li .secno { margin-left: -11rem; }

		/* Tighten up indentation in narrow ToCs */
		@media (max-width: 30em) {
			:not(li) > .toc              { margin-left:  4rem; }
			.toc .secno                  { margin-left: -4rem; }
			.toc > li li li              { margin-left:  1rem; }
			.toc > li li li .secno       { margin-left: -5rem; }
			.toc > li li li li .secno    { margin-left: -6rem; }
			.toc > li li li li li .secno { margin-left: -7rem; }
		}
	/* } */

	@supports (display:grid) and (display:contents) {
		/* Use #toc over .toc to override non-@supports rules. */
		#toc {
			display: grid;
			align-content: start;
			grid-template-columns: auto 1fr;
			grid-column-gap: 1rem;
			column-gap: 1rem;
			grid-row-gap: .6rem;
			row-gap: .6rem;
		}
		#toc h2 {
			grid-column: 1 / -1;
			margin-bottom: 0;
		}
		#toc ol,
		#toc li,
		#toc a {
			display: contents;
			/* Switch <a> to subgrid when supported */
		}
		#toc span {
			margin: 0;
		}
		#toc > .toc > li > a > span {
			/* The spans of the top-level list,
			   comprising the first items of each top-level section. */
			margin-top: 1.1rem;
		}
		#toc#toc .secno { /* Ugh, need more specificity to override base.css */
			grid-column: 1;
			width: auto;
			margin-left: 0;
		}
		#toc .content {
			grid-column: 2;
			width: auto;
			margin-right: 1rem;
		}
		#toc .content:hover {
			background: rgba(75%, 75%, 75%, .25);
			border-bottom: 3px solid #054572;
			margin-bottom: -3px;
		}
		#toc li li li .content {
			margin-left: 1rem;
		}
		#toc li li li li .content {
			margin-left: 2rem;
		}
	}


/** Index *********************************************************************/

	/* Index Lists: Layout */
	ul.index       { margin-left: 0; columns: 15em; text-indent: 1em hanging; }
	ul.index li    { margin-left: 0; list-style: none; break-inside: avoid; }
	ul.index li li { margin-left: 1em }
	ul.index dl    { margin-top: 0; }
	ul.index dt    { margin: .2em 0 .2em 20px;}
	ul.index dd    { margin: .2em 0 .2em 40px;}
	/* Index Lists: Typography */
	ul.index ul,
	ul.index dl { font-size: smaller; }
	@media not print {
		ul.index li span {
			white-space: nowrap;
			color: transparent; }
		ul.index li a:hover + span,
		ul.index li a:focus + span {
			color: #707070;
		}
	}

/** Index Tables *****************************************************/
	/* See also the data table styling section, which this effectively subclasses */

	table.index {
		font-size: small;
		border-collapse: collapse;
		border-spacing: 0;
		text-align: left;
		margin: 1em 0;
	}

	table.index td,
	table.index th {
		padding: 0.4em;
	}

	table.index tr:hover td:not([rowspan]),
	table.index tr:hover th:not([rowspan]) {
		background: #f7f8f9;
	}

	/* The link in the first column in the property table (formerly a TD) */
	table.index th:first-child a {
		font-weight: bold;
	}

/******************************************************************************/
/*                                    Print                                   */
/******************************************************************************/

	@media print {
		/* Pages have their own margins. */
		html {
			margin: 0;
		}
		/* Serif for print. */
		body {
			font-family: serif;
		}
	}
	@page {
		margin: 1.5cm 1.1cm;
	}

/******************************************************************************/
/*                                    Legacy                                  */
/******************************************************************************/

	/* This rule is inherited from past style sheets. No idea what it's for. */
	.hide { display: none }



/******************************************************************************/
/*                             Overflow Control                               */
/******************************************************************************/

	.figure .caption, .sidefigure .caption, figcaption {
		/* in case figure is overlarge, limit caption to 50em */
		max-width: 50rem;
		margin-left: auto;
		margin-right: auto;
	}
	.overlarge {
		/* Magic to create good table positioning:
		   "content column" is 50ems wide at max; less on smaller screens.
		   Extra space (after ToC + content) is empty on the right.

		   1. When table < content column, centers table in column.
		   2. When content < table < available, left-aligns.
		   3. When table > available, fills available + scroll bar.
		*/ 
		display: grid;
		grid-template-columns: minmax(0, 50em);
	}
	.overlarge > table {
		/* limit preferred width of table */
		max-width: 50em;
		margin-left: auto;
		margin-right: auto;
	}

	@media (min-width: 55em) {
		.overlarge {
			margin-right: calc(13px + 26.5rem - 50vw);
			max-width: none;
		}
	}
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) .overlarge {
			/* 30.5em body padding 50em content area */
			margin-right: calc(40em - 50vw) !important;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) .overlarge {
			/* 4em html margin 30.5em body padding 50em content area */
			margin-right: calc(84.5em - 100vw) !important;
		}
	}

	@media not print {
		.overlarge {
			overflow-x: auto;
			/* See Lea Verou's explanation background-attachment:
			 * http://lea.verou.me/2012/04/background-attachment-local/
			 *
			background: top left  / 4em 100% linear-gradient(to right,  #ffffff, rgba(255, 255, 255, 0)) local,
			            top right / 4em 100% linear-gradient(to left, #ffffff, rgba(255, 255, 255, 0)) local,
			            top left  / 1em 100% linear-gradient(to right,  #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            top right / 1em 100% linear-gradient(to left, #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            white;
			background-repeat: no-repeat;
			*/
		}
	}
</style>
<style>
    body {
      background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat white;
      background-attachment: fixed;
    }
  </style>
  <link href="https://www.w3.org/TR/generic-sensor/" rel="canonical">
<style>
    svg g.edge text {
        font-size: 8px;
    }

    svg g.node text {
        font-size: 10px;
    }
</style>
<style>
    #toc .current,
    #toc .current-parent {
      border-right-width: 3px;
      border-right-style: solid;
      border-right-color: #3980B5;
    }

    #toc .current {
      background: rgba(75%, 75%, 75%, .25);
      border-right-color: #054572;
    }
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-var-click-highlighting */

    var { cursor: pointer; }
    var.selected0 { background-color: #F4D200; box-shadow: 0 0 0 2px #F4D200; }
    var.selected1 { background-color: #FF87A2; box-shadow: 0 0 0 2px #FF87A2; }
    var.selected2 { background-color: #96E885; box-shadow: 0 0 0 2px #96E885; }
    var.selected3 { background-color: #3EEED2; box-shadow: 0 0 0 2px #3EEED2; }
    var.selected4 { background-color: #EACFB6; box-shadow: 0 0 0 2px #EACFB6; }
    var.selected5 { background-color: #82DDFF; box-shadow: 0 0 0 2px #82DDFF; }
    var.selected6 { background-color: #FFBCF2; box-shadow: 0 0 0 2px #FFBCF2; }
    </style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */
pre.idl.highlight { color: #708090; }
.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
c-[a] { color: #990055 } /* Keyword.Declaration */
c-[b] { color: #990055 } /* Keyword.Type */
c-[c] { color: #708090 } /* Comment */
c-[d] { color: #708090 } /* Comment.Multiline */
c-[e] { color: #0077aa } /* Name.Attribute */
c-[f] { color: #669900 } /* Name.Tag */
c-[g] { color: #222222 } /* Name.Variable */
c-[k] { color: #990055 } /* Keyword */
c-[l] { color: #000000 } /* Literal */
c-[m] { color: #000000 } /* Literal.Number */
c-[n] { color: #0077aa } /* Name */
c-[o] { color: #999999 } /* Operator */
c-[p] { color: #999999 } /* Punctuation */
c-[s] { color: #a67f59 } /* Literal.String */
c-[t] { color: #a67f59 } /* Literal.String.Single */
c-[u] { color: #a67f59 } /* Literal.String.Double */
c-[cp] { color: #708090 } /* Comment.Preproc */
c-[c1] { color: #708090 } /* Comment.Single */
c-[cs] { color: #708090 } /* Comment.Special */
c-[kc] { color: #990055 } /* Keyword.Constant */
c-[kn] { color: #990055 } /* Keyword.Namespace */
c-[kp] { color: #990055 } /* Keyword.Pseudo */
c-[kr] { color: #990055 } /* Keyword.Reserved */
c-[ld] { color: #000000 } /* Literal.Date */
c-[nc] { color: #0077aa } /* Name.Class */
c-[no] { color: #0077aa } /* Name.Constant */
c-[nd] { color: #0077aa } /* Name.Decorator */
c-[ni] { color: #0077aa } /* Name.Entity */
c-[ne] { color: #0077aa } /* Name.Exception */
c-[nf] { color: #0077aa } /* Name.Function */
c-[nl] { color: #0077aa } /* Name.Label */
c-[nn] { color: #0077aa } /* Name.Namespace */
c-[py] { color: #0077aa } /* Name.Property */
c-[ow] { color: #999999 } /* Operator.Word */
c-[mb] { color: #000000 } /* Literal.Number.Bin */
c-[mf] { color: #000000 } /* Literal.Number.Float */
c-[mh] { color: #000000 } /* Literal.Number.Hex */
c-[mi] { color: #000000 } /* Literal.Number.Integer */
c-[mo] { color: #000000 } /* Literal.Number.Oct */
c-[sb] { color: #a67f59 } /* Literal.String.Backtick */
c-[sc] { color: #a67f59 } /* Literal.String.Char */
c-[sd] { color: #a67f59 } /* Literal.String.Doc */
c-[se] { color: #a67f59 } /* Literal.String.Escape */
c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */
c-[si] { color: #a67f59 } /* Literal.String.Interpol */
c-[sx] { color: #a67f59 } /* Literal.String.Other */
c-[sr] { color: #a67f59 } /* Literal.String.Regex */
c-[ss] { color: #a67f59 } /* Literal.String.Symbol */
c-[vc] { color: #0077aa } /* Name.Variable.Class */
c-[vg] { color: #0077aa } /* Name.Variable.Global */
c-[vi] { color: #0077aa } /* Name.Variable.Instance */
c-[il] { color: #000000 } /* Literal.Number.Integer.Long */
</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
   <h1 class="p-name no-ref" id="title">Generic Sensor API</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <div data-fill-with="spec-metadata">
    <dl>
     <dt>This version:
     <dd><a class="u-url" href="https://w3c.github.io/sensors/">https://w3c.github.io/sensors/</a>
     <dt>Latest published version:
     <dd><a href="https://www.w3.org/TR/generic-sensor/">https://www.w3.org/TR/generic-sensor/</a>
     <dt>Previous Versions:
     <dd><a href="https://www.w3.org/TR/2019/WD-generic-sensor-20190307/" rel="prev">https://www.w3.org/TR/2019/WD-generic-sensor-20190307/</a>
     <dt>Feedback:
     <dd><span><a href="mailto:public-device-apis@w3.org?subject=%5Bgeneric-sensor%5D%20YOUR%20TOPIC%20HERE">public-device-apis@w3.org</a> with subject line “<kbd>[generic-sensor] <i data-lt>… message topic …</i></kbd>” (<a href="https://lists.w3.org/Archives/Public/public-device-apis/" rel="discussion">archives</a>)</span>
     <dd><a href="https://github.com/w3c/sensors">GitHub</a> (<a href="https://github.com/w3c/sensors/issues/new">new issue</a>, <a href="https://github.com/w3c/sensors/milestone/2">level 1 issues</a>, <a href="https://github.com/w3c/sensors/issues">all issues</a>)
     <dt class="editor">Editor:
     <dd class="editor p-author h-card vcard" data-editor-id="50572"><span class="p-name fn">Rick Waldron</span> (<span class="p-org org">Bocoup, formerly on behalf of JS Foundation</span>)
     <dt class="editor">Former Editors:
     <dd class="editor p-author h-card vcard" data-editor-id="78325"><a class="p-name fn u-url url" href="https://intel.com/">Mikhail Pozdnyakov</a> (<span class="p-org org">Intel Corporation</span>)
     <dd class="editor p-author h-card vcard" data-editor-id="78335"><a class="p-name fn u-url url" href="https://intel.com/">Alexander Shalamov</a> (<span class="p-org org">Intel Corporation</span>)
     <dd class="editor p-author h-card vcard" data-editor-id="60809"><a class="p-name fn u-url url" href="https://www.codespeaks.com/">Tobie Langel</a> (<span class="p-org org">Codespeaks, formerly on behalf of Intel Corporation</span>) <a class="u-email email" href="mailto:tobie@codespeaks.com">tobie@codespeaks.com</a>
     <dt>Test Facilitator:
     <dd>Wanming Lin (Intel Corporation)
     <dt>Other:
     <dd><a href="https://github.com/web-platform-tests/wpt/tree/master/generic-sensor">Test suite</a>, <a href="https://github.com/w3c/sensors/commits/master/index.bs">latest version history</a>, <a href="https://github.com/w3c/sensors/commits/gh-pages/index.bs">previous version history</a>
    </dl>
   </div>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="https://www.keio.ac.jp/">Keio</a>, <a href="https://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document" rel="license">permissive document license</a> rules apply. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>This specification defines a framework for exposing sensor data

  to the Open Web Platform in a consistent way.
  It does so by defining a blueprint for writing
  specifications of concrete sensors along with an abstract Sensor interface
  that can be extended to accommodate different sensor types.</p>
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="sotd"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This is a public copy of the editors’ draft.
	It is provided for discussion only and may change at any moment.
	Its publication here does not imply endorsement of its contents by W3C.
	Don’t cite this document other than as work in progress. </p>
   <p> If you wish to make comments regarding this document, please send them to <a href="mailto:public-device-apis@w3.org?Subject=%5Bgeneric-sensor%5D%20PUT%20SUBJECT%20HERE">public-device-apis@w3.org</a> (<a href="mailto:public-device-apis-request@w3.org?subject=subscribe">subscribe</a>, <a href="https://lists.w3.org/Archives/Public/public-device-apis/">archives</a>).
	When sending e-mail,
	please put the text “generic-sensor” in the subject,
	preferably like this:
	“[generic-sensor] <em>…summary of comment…</em>”.
	All comments are welcome. </p>
   <p> This document was produced by the <a href="https://www.w3.org/das/">Devices and Sensors Working Group</a>. </p>
   <p> This document was produced by a group operating under
	the <a href="https://www.w3.org/Consortium/Patent-Policy/">W3C Patent Policy</a>.
	W3C maintains a <a href="https://www.w3.org/2004/01/pp-impl/43696/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
	that page also includes instructions for disclosing a patent.
	An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
   <p> This document is governed by the <a href="https://www.w3.org/2019/Process-20190301/" id="w3c_process_revision">1 March 2019 W3C Process Document</a>. </p>
   <p></p>
   <p>Further implementation experience is being gathered for the <a data-link-type="dfn" href="https://wicg.github.io/permissions-request/#permission-request-algorithm" id="ref-for-permission-request-algorithm">permission request algorithm</a> and specification clarifications
informed by this experience are being discussed in <a href="https://github.com/w3c/sensors/issues/397">GitHub issue #397</a>.
The group does not expect to advance this specification beyond CR until <a data-link-type="biblio" href="#biblio-permissions-request">[PERMISSIONS-REQUEST]</a> moves beyond incubation.</p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li><a href="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a>
    <li><a href="#scope"><span class="secno">2</span> <span class="content">Scope</span></a>
    <li><a href="#feature-detection"><span class="secno">3</span> <span class="content">A note on Feature Detection of Hardware Features</span></a>
    <li>
     <a href="#security-and-privacy"><span class="secno">4</span> <span class="content">Security and privacy considerations</span></a>
     <ol class="toc">
      <li>
       <a href="#main-privacy-security-threats"><span class="secno">4.1</span> <span class="content">Types of privacy and security threats</span></a>
       <ol class="toc">
        <li><a href="#location-tracking"><span class="secno">4.1.1</span> <span class="content">Location Tracking</span></a>
        <li><a href="#eavesdropping"><span class="secno">4.1.2</span> <span class="content">Eavesdropping</span></a>
        <li><a href="#keystroke-monitoring"><span class="secno">4.1.3</span> <span class="content">Keystroke Monitoring</span></a>
        <li><a href="#device-fingerprinting"><span class="secno">4.1.4</span> <span class="content">Device Fingerprinting</span></a>
        <li><a href="#user-identifying"><span class="secno">4.1.5</span> <span class="content">User Identifying</span></a>
       </ol>
      <li>
       <a href="#mitigation-strategies"><span class="secno">4.2</span> <span class="content">Mitigation Strategies</span></a>
       <ol class="toc">
        <li><a href="#secure-context"><span class="secno">4.2.1</span> <span class="content">Secure Context</span></a>
        <li><a href="#feature-policy"><span class="secno">4.2.2</span> <span class="content">Feature Policy</span></a>
        <li><a href="#focused-area"><span class="secno">4.2.3</span> <span class="content">Focused Area</span></a>
        <li><a href="#visibility-state"><span class="secno">4.2.4</span> <span class="content">Visibility State</span></a>
        <li><a href="#permissions"><span class="secno">4.2.5</span> <span class="content">Permissions API</span></a>
       </ol>
      <li>
       <a href="#mitigation-strategies-case-by-case"><span class="secno">4.3</span> <span class="content">Mitigation strategies applied on a case by case basis</span></a>
       <ol class="toc">
        <li><a href="#limit-max-frequency"><span class="secno">4.3.1</span> <span class="content">Limit maximum sampling frequency</span></a>
        <li><a href="#stop-sensor"><span class="secno">4.3.2</span> <span class="content">Stop the sensor altogether</span></a>
        <li><a href="#limit-number-of-delivered-readings"><span class="secno">4.3.3</span> <span class="content">Limit number of delivered readings</span></a>
        <li><a href="#reduce-accuracy"><span class="secno">4.3.4</span> <span class="content">Reduce accuracy</span></a>
        <li><a href="#inform-user"><span class="secno">4.3.5</span> <span class="content">Keep the user informed about API use</span></a>
       </ol>
     </ol>
    <li>
     <a href="#concepts"><span class="secno">5</span> <span class="content">Concepts</span></a>
     <ol class="toc">
      <li><a href="#concepts-sensors"><span class="secno">5.1</span> <span class="content">Sensors</span></a>
      <li><a href="#concepts-sensor-types"><span class="secno">5.2</span> <span class="content">Sensor Types</span></a>
      <li><a href="#concepts-default-sensor"><span class="secno">5.3</span> <span class="content">Default sensor</span></a>
      <li><a href="#concepts-reading-change-threshold"><span class="secno">5.4</span> <span class="content">Reading change threshold</span></a>
      <li><a href="#concepts-sampling-and-reporting-frequencies"><span class="secno">5.5</span> <span class="content">Sampling Frequency and Reporting Frequency</span></a>
      <li><a href="#concepts-can-expose-sensor-readings"><span class="secno">5.6</span> <span class="content">Conditions to expose sensor readings</span></a>
     </ol>
    <li>
     <a href="#model"><span class="secno">6</span> <span class="content">Model</span></a>
     <ol class="toc">
      <li><a href="#model-sensor-type"><span class="secno">6.1</span> <span class="content">Sensor Type</span></a>
      <li><a href="#model-sensor"><span class="secno">6.2</span> <span class="content">Sensor</span></a>
     </ol>
    <li>
     <a href="#api"><span class="secno">7</span> <span class="content">API</span></a>
     <ol class="toc">
      <li>
       <a href="#the-sensor-interface"><span class="secno">7.1</span> <span class="content">The Sensor Interface</span></a>
       <ol class="toc">
        <li><a href="#sensor-lifecycle"><span class="secno">7.1.1</span> <span class="content">Sensor lifecycle</span></a>
        <li><a href="#sensor-garbage-collection"><span class="secno">7.1.2</span> <span class="content">Sensor garbage collection</span></a>
        <li><a href="#sensor-internal-slots"><span class="secno">7.1.3</span> <span class="content">Sensor internal slots</span></a>
        <li><a href="#sensor-activated"><span class="secno">7.1.4</span> <span class="content">Sensor.activated</span></a>
        <li><a href="#sensor-has-reading"><span class="secno">7.1.5</span> <span class="content">Sensor.hasReading</span></a>
        <li><a href="#sensor-timestamp"><span class="secno">7.1.6</span> <span class="content">Sensor.timestamp</span></a>
        <li><a href="#sensor-start"><span class="secno">7.1.7</span> <span class="content">Sensor.start()</span></a>
        <li><a href="#sensor-stop"><span class="secno">7.1.8</span> <span class="content">Sensor.stop()</span></a>
        <li><a href="#sensor-onreading"><span class="secno">7.1.9</span> <span class="content">Sensor.onreading</span></a>
        <li><a href="#sensor-onactivate"><span class="secno">7.1.10</span> <span class="content">Sensor.onactivate</span></a>
        <li><a href="#sensor-onerror"><span class="secno">7.1.11</span> <span class="content">Sensor.onerror</span></a>
        <li><a href="#event-handlers"><span class="secno">7.1.12</span> <span class="content">Event handlers</span></a>
       </ol>
      <li>
       <a href="#the-sensor-error-event-interface"><span class="secno">7.2</span> <span class="content">The SensorErrorEvent Interface</span></a>
       <ol class="toc">
        <li><a href="#sensor-error-event-error"><span class="secno">7.2.1</span> <span class="content">SensorErrorEvent.error</span></a>
       </ol>
     </ol>
    <li>
     <a href="#abstract-operations"><span class="secno">8</span> <span class="content">Abstract Operations</span></a>
     <ol class="toc">
      <li><a href="#initialize-a-sensor-object"><span class="secno">8.1</span> <span class="content">Initialize a sensor object</span></a>
      <li><a href="#check-sensor-policy-controlled-features"><span class="secno">8.2</span> <span class="content">Check sensor policy-controlled features</span></a>
      <li><a href="#connect-to-sensor"><span class="secno">8.3</span> <span class="content">Connect to sensor</span></a>
      <li><a href="#activate-a-sensor-object"><span class="secno">8.4</span> <span class="content">Activate a sensor object</span></a>
      <li><a href="#deactivate-a-sensor-object"><span class="secno">8.5</span> <span class="content">Deactivate a sensor object</span></a>
      <li><a href="#revoke-sensor-permission"><span class="secno">8.6</span> <span class="content">Revoke sensor permission</span></a>
      <li><a href="#set-sensor-settings"><span class="secno">8.7</span> <span class="content">Set sensor settings</span></a>
      <li><a href="#update-latest-reading"><span class="secno">8.8</span> <span class="content">Update latest reading</span></a>
      <li><a href="#find-the-reporting-frequency-of-a-sensor-object"><span class="secno">8.9</span> <span class="content">Find the reporting frequency of a sensor object</span></a>
      <li><a href="#report-latest-reading-updated"><span class="secno">8.10</span> <span class="content">Report latest reading updated</span></a>
      <li><a href="#notify-new-reading"><span class="secno">8.11</span> <span class="content">Notify new reading</span></a>
      <li><a href="#notify-activated-state"><span class="secno">8.12</span> <span class="content">Notify activated state</span></a>
      <li><a href="#notify-error"><span class="secno">8.13</span> <span class="content">Notify error</span></a>
      <li><a href="#get-value-from-latest-reading"><span class="secno">8.14</span> <span class="content">Get value from latest reading</span></a>
      <li><a href="#request-sensor-access"><span class="secno">8.15</span> <span class="content">Request sensor access</span></a>
     </ol>
    <li>
     <a href="#automation"><span class="secno">9</span> <span class="content">Automation</span></a>
     <ol class="toc">
      <li>
       <a href="#mock-sensors"><span class="secno">9.1</span> <span class="content">Mock Sensors</span></a>
       <ol class="toc">
        <li><a href="#dictionary-mocksensorconfiguration"><span class="secno">9.1.1</span> <span class="content">MockSensorConfiguration dictionary</span></a>
        <li><a href="#dictionary-mocksensor"><span class="secno">9.1.2</span> <span class="content">MockSensor dictionary</span></a>
        <li><a href="#section-mock-sensor-type"><span class="secno">9.1.3</span> <span class="content">Mock sensor type</span></a>
       </ol>
      <li>
       <a href="#section-extension-commands"><span class="secno">9.2</span> <span class="content">Extension Commands</span></a>
       <ol class="toc">
        <li><a href="#create-mock-sensor-command"><span class="secno">9.2.1</span> <span class="content">Create mock sensor</span></a>
        <li><a href="#get-mock-sensor-command"><span class="secno">9.2.2</span> <span class="content">Get mock sensor</span></a>
        <li><a href="#update-mock-sensor-reading-command"><span class="secno">9.2.3</span> <span class="content">Update mock sensor reading</span></a>
        <li><a href="#delete-mock-sensor-command"><span class="secno">9.2.4</span> <span class="content">Delete mock sensor</span></a>
       </ol>
      <li><a href="#extension-handling-errors"><span class="secno">9.3</span> <span class="content">Handling errors</span></a>
     </ol>
    <li>
     <a href="#extensibility"><span class="secno">10</span> <span class="content">Extensibility</span></a>
     <ol class="toc">
      <li><a href="#extension-security-and-privacy"><span class="secno">10.1</span> <span class="content">Security and Privacy</span></a>
      <li><a href="#naming"><span class="secno">10.2</span> <span class="content">Naming</span></a>
      <li><a href="#unit"><span class="secno">10.3</span> <span class="content">Unit</span></a>
      <li><a href="#high-vs-low-level"><span class="secno">10.4</span> <span class="content">Exposing High-Level vs. Low-Level Sensors</span></a>
      <li><a href="#multiple-sensors"><span class="secno">10.5</span> <span class="content">When is Enabling Multiple Sensors of the Same Type Not the Right Choice?</span></a>
      <li><a href="#definition-reqs"><span class="secno">10.6</span> <span class="content">Definition Requirements</span></a>
      <li><a href="#extend-automation"><span class="secno">10.7</span> <span class="content">Automation</span></a>
      <li><a href="#permission-api"><span class="secno">10.8</span> <span class="content">Extending the Permission API</span></a>
      <li><a href="#feature-policy-api"><span class="secno">10.9</span> <span class="content">Extending the Feature Policy API</span></a>
      <li><a href="#example-webidl"><span class="secno">10.10</span> <span class="content">Example WebIDL</span></a>
     </ol>
    <li><a href="#acknowledgements"><span class="secno">11</span> <span class="content">Acknowledgements</span></a>
    <li>
     <a href="#conformance"><span class="secno"></span> <span class="content">Conformance</span></a>
     <ol class="toc">
      <li><a href="#conventions"><span class="secno"></span> <span class="content">Document conventions</span></a>
      <li><a href="#conformant-algorithms"><span class="secno"></span> <span class="content">Conformant Algorithms</span></a>
      <li><a href="#conformance-classes"><span class="secno"></span> <span class="content">Conformance Classes</span></a>
     </ol>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
      <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
     </ol>
    <li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a>
   </ol>
  </nav>
  <main>
   <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>
   <p>Increasingly, sensor data is used in application development to
enable new use cases such as geolocation,
counting steps or head-tracking.
This is especially true on mobile devices where new sensors are added regularly.</p>
   <p>Exposing sensor data to the Web
has so far been both slow-paced and ad-hoc.
Few sensors are already exposed to the Web.
When they are, it is often in ways that limit their possible use cases
(for example by exposing abstractions that are too <a data-link-type="dfn" href="#high-level" id="ref-for-high-level">high-level</a> and which don’t perform well enough).
APIs also vary greatly from one sensor to the next
which increases the cognitive burden of Web application developers
and slows development.</p>
   <p>The goal of the Generic Sensor API is to
promote consistency across sensor APIs,
enable advanced use cases thanks to performant <a data-link-type="dfn" href="#low-level" id="ref-for-low-level">low-level</a> APIs,
and increase the pace at which new sensors can be exposed to the Web
by simplifying the specification and implementation processes.</p>
   <p>A comprehensive list of concrete sensors that are based on Generic Sensor API, applicable use
cases, and code examples can be found in <a data-link-type="biblio" href="#biblio-generic-sensor-usecases">[GENERIC-SENSOR-USECASES]</a> and <a data-link-type="biblio" href="#biblio-motion-sensors">[MOTION-SENSORS]</a> explainer documents.</p>
   <h2 class="heading settled" data-level="2" id="scope"><span class="secno">2. </span><span class="content">Scope</span><a class="self-link" href="#scope"></a></h2>
   <p><em>This section is non-normative</em>.</p>
   <p>The scope of this specification is currently limited
to specifying primitives which enable exposing data from <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor">device sensors</a>.</p>
   <p>Exposing remote sensors
or sensors found on personal area networks (e.g. Bluetooth)
is out of scope.
As work in these areas mature,
it is possible that common, lower-level primitives be found,
in which case this specification will be updated accordingly.
This should have little to no effects on implementations, however.</p>
   <p>This specification also does not currently expose a
sensor discovery API.
This is because the limited number of sensors currently available to user agents
does not warrant such an API.
Using feature detection, such as described in <a href="#feature-detection">§ 3 A note on Feature Detection of Hardware Features</a>,
is good enough for now.
A subsequent version of this specification might specify such an API,
and the current API has been designed with this in mind.</p>
   <h2 class="heading settled" data-level="3" id="feature-detection"><span class="secno">3. </span><span class="content">A note on Feature Detection of Hardware Features</span><a class="self-link" href="#feature-detection"></a></h2>
   <p><em>This section is non-normative.</em></p>
   <p>Feature detection is an established Web development best practice.
Resources on the topic are plentiful on and offline and
the purpose of this section is not to discuss it further,
but rather to put it in the context of detecting hardware-dependent features.</p>
   <p>Consider the below feature detection examples:</p>
   <div class="example" id="example-250d1979">
    <a class="self-link" href="#example-250d1979"></a> This simple example illustrates how to check whether the User Agent
    exposes an interface for a particular sensor type. To handle errors in a robust
    manner, please refer to <a href="#robust-example">this example</a>. 
<pre class="highlight"><c- k>if</c-> <c- p>(</c-><c- k>typeof</c-> Gyroscope <c- o>===</c-> <c- u>"function"</c-><c- p>)</c-> <c- p>{</c->
    <c- c1>// run in circles...</c->
<c- p>}</c->

<c- k>if</c-> <c- p>(</c-><c- u>"ProximitySensor"</c-> <c- k>in</c-> window<c- p>)</c-> <c- p>{</c->
    <c- c1>// watch out!</c->
<c- p>}</c->

<c- k>if</c-> <c- p>(</c->window<c- p>.</c->AmbientLightSensor<c- p>)</c-> <c- p>{</c->
    <c- c1>// go dark...</c->
<c- p>}</c->

<c- c1>// etc.</c->
</pre>
   </div>
   <p>All of these tell you something about the presence
and possible characteristics of an API.
They do not tell you anything, however, about whether
that API is actually connected to a real hardware sensor,
whether that sensor works,
if its still connected,
or even whether the user is going to allow you to access it.
Note you can check the latter using the Permissions API <a data-link-type="biblio" href="#biblio-permissions">[PERMISSIONS]</a>.</p>
   <p>In an ideal world, information about the underlying status
would be available upfront.
The problem with this is twofold.
First, getting this information out of the hardware is costly,
in both performance and battery time,
and would sit in the critical path.
Secondly, the status of the underlying hardware can evolve over time.
The user can revoke permission, the connection to the sensor be severed,
the operating system may decide to limit sensor usage below a certain battery threshold,
etc.</p>
   <p>Therefore, an effective strategy is to combine feature detection,
which checks whether an API for the sought-after sensor actually exists,
and defensive programming which includes:</p>
   <ol>
    <li data-md>
     <p>checking for error thrown when instantiating a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor">Sensor</a></code> object,</p>
    <li data-md>
     <p>listening to errors emitted by it,</p>
    <li data-md>
     <p>handling all of the above graciously so that the user’s experience is
  enhanced by the possible usage of a sensor, not degraded by its
  absence.</p>
   </ol>
   <div class="example" id="robust-example">
    <a class="self-link" href="#robust-example"></a> The following snippet illustrates how an Accelerometer sensor can be created
    in a robust manner. Web application may choose different options for error
    handling, for example, show notification, choose different sensor type or
    fallback to other API. 
<pre class="highlight"><c- a>let</c-> accelerometer <c- o>=</c-> <c- kc>null</c-><c- p>;</c->
<c- k>try</c-> <c- p>{</c->
    accelerometer <c- o>=</c-> <c- k>new</c-> Accelerometer<c- p>({</c-> frequency<c- o>:</c-> <c- mi>10</c-> <c- p>});</c->
    accelerometer<c- p>.</c->addEventListener<c- p>(</c-><c- t>'error'</c-><c- p>,</c-> event <c- p>=></c-> <c- p>{</c->
        <c- c1>// Handle runtime errors.</c->
        <c- k>if</c-> <c- p>(</c->event<c- p>.</c->error<c- p>.</c->name <c- o>===</c-> <c- t>'NotAllowedError'</c-><c- p>)</c-> <c- p>{</c->
            console<c- p>.</c->log<c- p>(</c-><c- t>'Permission to access sensor was denied.'</c-><c- p>);</c->
        <c- p>}</c-> <c- k>else</c-> <c- k>if</c-> <c- p>(</c->event<c- p>.</c->error<c- p>.</c->name <c- o>===</c-> <c- t>'NotReadableError'</c-> <c- p>)</c-> <c- p>{</c->
            console<c- p>.</c->log<c- p>(</c-><c- t>'Cannot connect to the sensor.'</c-><c- p>);</c->
        <c- p>}</c->
    <c- p>});</c->
    accelerometer<c- p>.</c->addEventListener<c- p>(</c-><c- t>'reading'</c-><c- p>,</c-> <c- p>()</c-> <c- p>=></c-> reloadOnShake<c- p>(</c->accelerometer<c- p>));</c->
    accelerometer<c- p>.</c->start<c- p>();</c->
<c- p>}</c-> <c- k>catch</c-> <c- p>(</c->error<c- p>)</c-> <c- p>{</c->
    <c- c1>// Handle construction errors.</c->
    <c- k>if</c-> <c- p>(</c->error<c- p>.</c->name <c- o>===</c-> <c- t>'SecurityError'</c-><c- p>)</c-> <c- p>{</c->
        console<c- p>.</c->log<c- p>(</c-><c- t>'Sensor construction was blocked by the Feature Policy.'</c-><c- p>);</c->
    <c- p>}</c-> <c- k>else</c-> <c- k>if</c-> <c- p>(</c->error<c- p>.</c->name <c- o>===</c-> <c- t>'ReferenceError'</c-><c- p>)</c-> <c- p>{</c->
        console<c- p>.</c->log<c- p>(</c-><c- t>'Sensor is not supported by the User Agent.'</c-><c- p>);</c->
    <c- p>}</c-> <c- k>else</c-> <c- p>{</c->
        <c- k>throw</c-> error<c- p>;</c->
    <c- p>}</c->
<c- p>}</c->
</pre>
   </div>
   <h2 class="heading settled" data-level="4" id="security-and-privacy"><span class="secno">4. </span><span class="content">Security and privacy considerations</span><a class="self-link" href="#security-and-privacy"></a></h2>
   <div class="note" role="note"> The judgement on how to communicate to the user the known <a href="#main-privacy-security-threats">threats</a> is up to the implementer. The implementation of the <a href="#mitigation-strategies">mitigations</a> is
mandatory, however. </div>
   <p><a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading">Sensor readings</a> are sensitive data and could become a subject of
various attacks from malicious Web pages. Before discussing the mitigation strategies we
briefly enumerate the main types of the <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor①">sensor</a>'s privacy and security threats.
The <a data-link-type="biblio" href="#biblio-mobilesensors">[MOBILESENSORS]</a> categorizes main threats into <a href="#location-tracking">location tracking</a>, <a href="#eavesdropping">eavesdropping</a>, <a href="#keystroke-monitoring">keystroke monitoring</a>, <a href="#device-fingerprinting">device fingerprinting</a>, and <a href="#user-identifying">user identification</a>.
This categorization is a good fit for this specification.</p>
   <p>The risk of successful attack can increase when <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor②">sensors</a> are used with each other,
in combination with other functionality, or when used over time,
specifically with the risk of correlation of data
and user identification through fingerprinting.
Web application developers using these JavaScript APIs should
consider how this information might be correlated with other information
and the privacy risks that might be created.
The potential risks of collection of such data over a longer period of time
should also be considered.</p>
   <p>Variations in <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading①">sensor readings</a> as well as event firing rates
offer the possibility of fingerprinting to identify users.
User agents may reduce the risk by
limiting event rates available to web application developers.</p>
   <p>Minimizing the accuracy of a sensor’s readout
generally decreases the risk of fingerprinting.
User agents should not provide unnecessarily verbose readouts of sensors data.
Each <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type">sensor type</a> should be assessed individually.</p>
   <p>If the same JavaScript code using the API can be
used simultaneously in different window contexts on the same device
it may be possible for that code to correlate the user across those two contexts,
creating unanticipated tracking mechanisms.</p>
   <p>User agents should consider providing the user
an indication of when the <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor③">sensor</a> is used
and allowing the user to disable it.
Additionally, user agents may consider
allowing the user to verify past and current sensor use patterns.</p>
   <p>Web application developers that use <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor④">sensors</a> should
perform a privacy impact assessment of their application
taking all aspects of their application into consideration.</p>
   <p>Ability to detect a full working set of sensors on a device can form an
identifier and could be used for fingerprinting.</p>
   <p>A combination of selected sensors can potentially be used to form an out of
band communication channel between devices.</p>
   <p>Sensors can potentially be used in cross-device linking and tracking of a user.</p>
   <h3 class="heading settled" data-level="4.1" id="main-privacy-security-threats"><span class="secno">4.1. </span><span class="content">Types of privacy and security threats</span><a class="self-link" href="#main-privacy-security-threats"></a></h3>
   <p><em>This section is non-normative.</em></p>
   <h4 class="heading settled" data-level="4.1.1" id="location-tracking"><span class="secno">4.1.1. </span><span class="content">Location Tracking</span><a class="self-link" href="#location-tracking"></a></h4>
   <p>Under this type of threat, the attacks use <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading②">sensor readings</a> to locate the device without
using GPS or any other location sensors. For example, accelerometer data can be used to infer
the location of smartphones by using statistical models to obtain estimated trajectory,
then map matching algorithms can be used to obtain predicted location points (within a
200-m radius)<a data-link-type="biblio" href="#biblio-mobilesensors">[MOBILESENSORS]</a>.</p>
   <h4 class="heading settled" data-level="4.1.2" id="eavesdropping"><span class="secno">4.1.2. </span><span class="content">Eavesdropping</span><a class="self-link" href="#eavesdropping"></a></h4>
   <p>Recovering speech from gyroscope <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading③">readings</a> is an example of eavesdropping attack.
See <a data-link-type="biblio" href="#biblio-gyrospeechrecognition">[GYROSPEECHRECOGNITION]</a>.</p>
   <h4 class="heading settled" data-level="4.1.3" id="keystroke-monitoring"><span class="secno">4.1.3. </span><span class="content">Keystroke Monitoring</span><a class="self-link" href="#keystroke-monitoring"></a></h4>
   <p>Many user inputs can be inferred from <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading④">sensor readings</a>, this includes a wide range of attacks
on user PINs, passwords, and lock patterns (and even touch actions such as click, scroll, and
zoom) using motion sensors. These attacks normally train a machine learning algorithm to
discover such information about the users. See <a data-link-type="biblio" href="#biblio-stealingpinsviasensors">[STEALINGPINSVIASENSORS]</a>.</p>
   <h4 class="heading settled" data-level="4.1.4" id="device-fingerprinting"><span class="secno">4.1.4. </span><span class="content">Device Fingerprinting</span><a class="self-link" href="#device-fingerprinting"></a></h4>
   <p>Sensors can provide information that can uniquely identify the device using those sensors.
Every concrete sensor model has minor manufacturing imperfections and differences that will be
unique for this model. These manufacturing variations and imperfections can be used to fingerprint
the device <a data-link-type="biblio" href="#biblio-accelprint">[ACCELPRINT]</a> <a data-link-type="biblio" href="#biblio-mobilesensors">[MOBILESENSORS]</a>.</p>
   <h4 class="heading settled" data-level="4.1.5" id="user-identifying"><span class="secno">4.1.5. </span><span class="content">User Identifying</span><a class="self-link" href="#user-identifying"></a></h4>
   <p><a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑤">Sensor readings</a> can be used to identify the user, for example via inferring
individual walking patterns from smartphone or wearable device motion sensors' data.</p>
   <h3 class="heading settled" data-level="4.2" id="mitigation-strategies"><span class="secno">4.2. </span><span class="content">Mitigation Strategies</span><a class="self-link" href="#mitigation-strategies"></a></h3>
   <p><em>This section is non-normative.</em></p>
   <p>This section gives a high-level presentation of some of the mitigation strategies
specified in the normative sections of this specification.</p>
   <h4 class="heading settled" data-level="4.2.1" id="secure-context"><span class="secno">4.2.1. </span><span class="content">Secure Context</span><a class="self-link" href="#secure-context"></a></h4>
   <p><a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑥">Sensor readings</a> are explicitly flagged by the
Secure Contexts specification <a data-link-type="biblio" href="#biblio-powerful-features">[POWERFUL-FEATURES]</a> as a high-value target for network attackers.
Thus all interfaces defined by this specification
or <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification">extension specifications</a> are only available within a <a data-link-type="dfn" href="https://w3c.github.io/webappsec-secure-contexts/#secure-contexts" id="ref-for-secure-contexts">secure context</a>.</p>
   <h4 class="heading settled" data-level="4.2.2" id="feature-policy"><span class="secno">4.2.2. </span><span class="content">Feature Policy</span><span id="browsing-context"></span><a class="self-link" href="#feature-policy"></a></h4>
   <p>To avoid the privacy risk of sharing <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑦">sensor readings</a> with contexts unfamiliar
to the user, <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑧">sensor readings</a> are only available for the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document" id="ref-for-concept-document">documents</a> which are <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#should-request-be-allowed-to-use-feature" id="ref-for-should-request-be-allowed-to-use-feature">allowed to use</a> the <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature">policy-controlled features</a> for
the given <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type①">sensor type</a>. See <a data-link-type="biblio" href="#biblio-feature-policy">[FEATURE-POLICY]</a> for more details.</p>
   <h4 class="heading settled" data-level="4.2.3" id="focused-area"><span class="secno">4.2.3. </span><span class="content">Focused Area</span><span id="losing-focus"></span><a class="self-link" href="#focused-area"></a></h4>
   <p><a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑨">Sensor readings</a> are only available for <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document">active documents</a> whose
origin is <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin-domain" id="ref-for-same-origin-domain">same origin-domain</a> with the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#currently-focused-area-of-a-top-level-browsing-context" id="ref-for-currently-focused-area-of-a-top-level-browsing-context">currently focused area</a> document.</p>
   <p>This is done in order to mitigate the risk of a skimming attack against the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context">browsing context</a> containing an element which has <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#gains-focus" id="ref-for-gains-focus">gained focus</a>,
for example when the user carries out an in-game purchase using a third party
payment service from within an iframe.</p>
   <h4 class="heading settled" data-level="4.2.4" id="visibility-state"><span class="secno">4.2.4. </span><span class="content">Visibility State</span><a class="self-link" href="#visibility-state"></a></h4>
   <p><a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading①⓪">Sensor readings</a> are only available for the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document①">active documents</a> whose <a data-link-type="dfn" href="https://www.w3.org/TR/page-visibility-2/#dfn-steps-to-determine-the-visibility-state" id="ref-for-dfn-steps-to-determine-the-visibility-state">visibility state</a> is "visible".</p>
   <h4 class="heading settled" data-level="4.2.5" id="permissions"><span class="secno">4.2.5. </span><span class="content">Permissions API</span><span id="permissioning"></span><a class="self-link" href="#permissions"></a></h4>
   <p>Access to <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading①①">sensor readings</a> are controlled by the Permissions API <a data-link-type="biblio" href="#biblio-permissions">[PERMISSIONS]</a>.</p>
   <h3 class="heading settled" data-level="4.3" id="mitigation-strategies-case-by-case"><span class="secno">4.3. </span><span class="content">Mitigation strategies applied on a case by case basis</span><a class="self-link" href="#mitigation-strategies-case-by-case"></a></h3>
   <p>Each <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type②">sensor type</a> will need to be assessed individually,
taking into account the use cases it enables
and its particular threat profile.
While some of the below mitigation strategies
are effective for certain sensors,
they might also hinder or altogether prevent certain use cases.</p>
   <p class="note" role="note"><span>Note:</span> These mitigation strategies can be applied constantly or temporarily,
for example when the user is carrying out specific actions,
when other APIs which are known to amplify the level of the threat are in use,
etc.</p>
   <h4 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="4.3.1" data-lt="Limit maximum sampling frequency" data-noexport id="limit-max-frequency"><span class="secno">4.3.1. </span><span class="content">Limit maximum sampling frequency</span></h4>
   <p>User agents may mitigate certain threats by
limiting the maximum <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency">sampling frequency</a>.
What upper limit to choose depends on the <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type③">sensor type</a>,
the kind of threats the user agent is trying to protect against,
the expected resources of the attacker, etc.</p>
   <p>Limiting the maximum <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency①">sampling frequency</a> prevents use cases
which rely on low latency or high data density.</p>
   <h4 class="heading settled" data-dfn-type="dfn" data-level="4.3.2" data-lt="Stop the sensor altogether" data-noexport id="stop-sensor"><span class="secno">4.3.2. </span><span class="content">Stop the sensor altogether</span><a class="self-link" href="#stop-sensor"></a></h4>
   <p>This is obviously a last-resort solution,
but it can be extremely effective if it’s temporal,
for example to prevent password skimming attempts
when the user is entering credentials on a different origin (<a data-link-type="biblio" href="#biblio-rfc6454">[rfc6454]</a>)
or in a different application.</p>
   <h4 class="heading settled" data-dfn-type="dfn" data-level="4.3.3" data-lt="Limit number of delivered readings" data-noexport id="limit-number-of-delivered-readings"><span class="secno">4.3.3. </span><span class="content">Limit number of delivered readings</span><a class="self-link" href="#limit-number-of-delivered-readings"></a></h4>
   <p>An alternative to <a data-link-type="dfn" href="#limit-max-frequency" id="ref-for-limit-max-frequency">limiting the maximum sampling frequency</a> is to
limit the number of <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading①②">sensor readings</a> delivered to Web application developer,
regardless of what frequency the sensor is polled at.
This allows use cases which have low latency requirement
to increase <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency②">sampling frequency</a> without increasing the amount of data provided.</p>
   <p>Discarding intermediary readings prevents certain use cases,
such as those relying on certain kinds of filters.</p>
   <h4 class="heading settled" data-dfn-type="dfn" data-level="4.3.4" data-lt="Reduce accuracy" data-noexport id="reduce-accuracy"><span class="secno">4.3.4. </span><span class="content">Reduce accuracy</span><a class="self-link" href="#reduce-accuracy"></a></h4>
   <p>Reducing the accuracy of <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading①③">sensor readings</a> or sensor <a data-link-type="dfn" href="#reading-timestamp" id="ref-for-reading-timestamp">reading timestamps</a> might also help mitigate certain threats,
thus user agents should not provide
unnecessarily verbose readouts of sensors data.</p>
   <p class="note" role="note"><span>Note:</span> Inaccuracies will further increase for operations carried out on the <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading①④">sensor readings</a>, or time deltas calculated from the <a data-link-type="dfn" href="#reading-timestamp" id="ref-for-reading-timestamp①">timestamps</a>.
So, this mitigation strategy can affect certain use cases.</p>
   <p class="note" role="note"><span>Note:</span> while adding random bias to <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading①⑤">sensor readings</a> has similar effects,
it shouldn’t be used in practice
as it is easy to filter out the added noise.</p>
   <h4 class="heading settled" data-level="4.3.5" id="inform-user"><span class="secno">4.3.5. </span><span class="content">Keep the user informed about API use</span><a class="self-link" href="#inform-user"></a></h4>
   <p>User agents may choose to keep the user informed
about current and past use of the API.</p>
   <p class="note" role="note"><span>Note:</span> this does not imply keeping a log of the actual <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading①⑥">sensor readings</a> which would have issues of its own.</p>
   <h2 class="heading settled" data-level="5" id="concepts"><span class="secno">5. </span><span class="content">Concepts</span><a class="self-link" href="#concepts"></a></h2>
   <h3 class="heading settled" data-level="5.1" id="concepts-sensors"><span class="secno">5.1. </span><span class="content">Sensors</span><a class="self-link" href="#concepts-sensors"></a></h3>
   <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="concept-device-sensor">device sensor</dfn> refers to a device’s underlying
physical sensor instance.</p>
   <p>A <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor⑤">device sensor</a> measures a physical quantities
and provides a corresponding <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="sensor-reading">sensor reading</dfn> which is a source of information about the environment.</p>
   <p>Each <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading①⑦">sensor reading</a> is composed of the <dfn data-dfn-type="dfn" data-lt="reading value" data-noexport id="reading-value">values<a class="self-link" href="#reading-value"></a></dfn> of the physical quantity measured by the <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor⑥">device sensor</a> at time <var>t<sub>n</sub></var> which is called the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="reading-timestamp">reading timestamp</dfn>.</p>
   <p>If the <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor⑦">device sensor</a> performs a spatial measurement (e.g.
acceleration, angular velocity), it must be resolved in
a <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="local-coordinate-system">local coordinate system</dfn> that represents
a reference frame for the <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor⑧">device sensor</a>'s <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading①⑧">sensor readings</a>.
A <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor⑨">device sensor</a> that provides such <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading①⑨">sensor readings</a> is referred to as <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="spatial-sensor">spatial sensor</dfn>.</p>
   <p>A <a data-link-type="dfn" href="#spatial-sensor" id="ref-for-spatial-sensor">spatial sensor</a> can be <dfn data-dfn-type="dfn" data-noexport id="uniaxial">uniaxial<a class="self-link" href="#uniaxial"></a></dfn>, <dfn data-dfn-type="dfn" data-noexport id="biaxial">biaxial<a class="self-link" href="#biaxial"></a></dfn>,
or <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="triaxial">triaxial</dfn>, depending on the number of orthogonal axes in
which it can perform simultaneous measurements.</p>
   <p>Scalar physical quantities (i.e. temperature) do not require
a <a data-link-type="dfn" href="#local-coordinate-system" id="ref-for-local-coordinate-system">local coordinate system</a> for resolution.</p>
   <p>The <a data-link-type="dfn" href="#local-coordinate-system" id="ref-for-local-coordinate-system①">local coordinate system</a> normally used in a mobile device is
a Cartesian coordinate system, which is defined relative to the
device’s screen, so that X and Y axes are parallel to the screen
dimentions and Z axis is perpendicular to the screen surface.</p>
   <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="concept-platform-sensor">platform sensor</dfn> refers to platform interfaces,
with which the user agent interacts to obtain <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading②⓪">sensor readings</a> for a single <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type④">sensor type</a> originated from one or more <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor①⓪">device sensors</a>.</p>
   <p><a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor">Platform sensor</a> can be defined by the underlying platform (e.g. in a native sensors framework)
or by the user agent, if it has a direct access to <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor①①">device sensor</a>.</p>
   <p>From the implementation perspective <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor①">platform sensor</a> can be treated as a software proxy for the
corresponding <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor①②">device sensor</a>. It is possible to have multiple <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor②">platform sensors</a> simultaneously
interacting with the same <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor①③">device sensor</a> if the underlying platform suppports it.</p>
   <p>In simple cases, a <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor③">platform sensor</a> corresponds to a single <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor①④">device sensor</a>,
but if the provided <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading②①">sensor readings</a> are a product of <a data-link-type="dfn" href="#sensor-fusion" id="ref-for-sensor-fusion">sensor fusion</a> performed
in software, the <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor④">platform sensor</a> corresponds to a set of <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor①⑤">device sensors</a> involved in the <a data-link-type="dfn" href="#sensor-fusion" id="ref-for-sensor-fusion①">sensor fusion</a> process.</p>
   <p>Discrepancies between a <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading②②">sensor reading</a> and the corresponding physical quantity being measured
are corrected through <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="calibration">calibration</dfn> that can happen at manufacturing time.
Some sensors can require dynamic calibration to compensate unknown discrepancies.</p>
   <p class="note" role="note"><span>Note:</span> <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor⑤">platform sensors</a> created through <a data-link-type="dfn" href="#sensor-fusion" id="ref-for-sensor-fusion②">sensor fusion</a> are sometimes
called virtual or synthetic sensors. However, the specification doesn’t
make any practical distinction between them.</p>
   <h3 class="heading settled" data-level="5.2" id="concepts-sensor-types"><span class="secno">5.2. </span><span class="content">Sensor Types</span><a class="self-link" href="#concepts-sensor-types"></a></h3>
   <p>Different <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type⑤">sensor types</a> measure different physical quantities
such as temperature, air pressure, heart-rate, or luminosity.</p>
   <p>For the purpose of this specification we distinguish between <a data-link-type="dfn" href="#high-level" id="ref-for-high-level①">high-level</a> and <a data-link-type="dfn" href="#low-level" id="ref-for-low-level①">low-level</a> <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type⑥">sensor types</a>.</p>
   <p><a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type⑦">Sensor types</a> which are characterized by their implementation
are referred to as <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="low-level">low-level</dfn> sensors.
For example a Gyroscope is a <a data-link-type="dfn" href="#low-level" id="ref-for-low-level②">low-level</a> <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type⑧">sensor type</a>.</p>
   <p>Sensors named after their <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading②③">readings</a>,
regardless of the implementation,
are said to be <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="high-level">high-level</dfn> sensors.
For instance, geolocation sensors provide information about the user’s location,
but the precise means by which this data is obtained
is purposefully left opaque
(it could come from a GPS chip, network cell triangulation,
wifi networks, etc. or any combination of the above)
and depends on various, implementation-specific heuristics. <a data-link-type="dfn" href="#high-level" id="ref-for-high-level②">High-level</a> sensors are generally the fruits of
applying algorithms to <a data-link-type="dfn" href="#low-level" id="ref-for-low-level③">low-level</a> sensors—<wbr>for example, a pedometer can be built using only the output of a gyroscope—<wbr>or of <a data-link-type="dfn" href="#sensor-fusion" id="ref-for-sensor-fusion③">sensor fusion</a>.</p>
   <p>That said, the distinction between <a data-link-type="dfn" href="#high-level" id="ref-for-high-level③">high-level</a> and <a data-link-type="dfn" href="#low-level" id="ref-for-low-level④">low-level</a> <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type⑨">sensor types</a> is somewhat arbitrary and the line between the two is often blurred.
For instance, a barometer, which measures air pressure,
would be considered <a data-link-type="dfn" href="#low-level" id="ref-for-low-level⑤">low-level</a> for most common purposes,
even though it is the product of the <a data-link-type="dfn" href="#sensor-fusion" id="ref-for-sensor-fusion④">sensor fusion</a> of
resistive piezo-electric pressure and temperature sensors.
Exposing the sensors that compose it would serve no practical purpose;
who cares about the temperature of a piezo-electric sensor?
A pressure-altimeter would probably fall in the same category,
while a nondescript altimeter—<wbr>which could get its data from either a barometer or a GPS signal—<wbr>would clearly be categorized as a <a data-link-type="dfn" href="#high-level" id="ref-for-high-level④">high-level</a> <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type①⓪">sensor type</a>.</p>
   <p>Because the distinction is somewhat blurry,
extensions to this specification (see <a href="#extensibility">§ 10 Extensibility</a>)
are encouraged to provide domain-specific definitions of <a data-link-type="dfn" href="#high-level" id="ref-for-high-level⑤">high-level</a> and <a data-link-type="dfn" href="#low-level" id="ref-for-low-level⑥">low-level</a> sensors
for the given <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type①①">sensor types</a> they are targeting.</p>
   <p><a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading②④">Sensor readings</a> from different <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type①②">sensor types</a> can be combined together
through a process called <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="sensor-fusion">sensor fusion</dfn>.
This process provides <a data-link-type="dfn" href="#high-level" id="ref-for-high-level⑥">higher-level</a> or
more accurate data (often at the cost of increased latency).
For example, the <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading②⑤">readings</a> of a <a data-link-type="dfn" href="#triaxial" id="ref-for-triaxial">triaxial</a> magnetometer
needs to be combined with the <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading②⑥">readings</a> of an accelerometer
to provide a correct bearing.</p>
   <p><dfn data-dfn-type="dfn" data-noexport id="smart-sensors">Smart sensors<a class="self-link" href="#smart-sensors"></a></dfn> and <dfn data-dfn-type="dfn" data-noexport id="sensor-hubs">sensor hubs<a class="self-link" href="#sensor-hubs"></a></dfn> have built-in compute resources which allow them
to carry out <a data-link-type="dfn" href="#calibration" id="ref-for-calibration">calibration</a> and <a data-link-type="dfn" href="#sensor-fusion" id="ref-for-sensor-fusion⑤">sensor fusion</a> at the hardware level,
freeing up CPU resources and lowering battery consumption in the process.</p>
   <p><a data-link-type="dfn" href="#sensor-fusion" id="ref-for-sensor-fusion⑥">Sensor fusion</a> can also be carried out in software if it cannot be
performed at the hardware level or if an application-specific <a data-link-type="dfn" href="#sensor-fusion" id="ref-for-sensor-fusion⑦">fusion</a> algorithm is required.</p>
   <h3 class="heading settled" data-level="5.3" id="concepts-default-sensor"><span class="secno">5.3. </span><span class="content">Default sensor</span><a class="self-link" href="#concepts-default-sensor"></a></h3>
   <p>The Generic Sensor API is designed to make the most common use cases straightforward
while still enabling more complex use cases.</p>
   <p>Most of devices deployed today do not carry more than one <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor①⑥">device sensor</a> providing <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading②⑦">sensor readings</a> of the same <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type①③">type</a>.
The use cases which require a set of similar <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor①⑦">device sensors</a> are rare
and generally limited to specific <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type①④">sensor types</a>,
such as multiple accelerometers in 2-in-1 laptops.</p>
   <p>The API therefore makes it easy to interact with
the device’s default (and often unique) <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor①⑧">sensor</a> for each <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type①⑤">type</a> simply by instantiating the corresponding <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor①">Sensor</a></code> subclass.</p>
   <p>Indeed, without specific information identifying a particular <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor①⑨">sensor</a> of a given <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type①⑥">type</a>, the <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="default-sensor">default sensor</dfn> is chosen by the
user agent.</p>
   <p>If the underlying platform provides an interface to find the <a data-link-type="dfn" href="#default-sensor" id="ref-for-default-sensor">default sensor</a>,
the user agent must choose the sensor offered by the platform, otherwise the user agent
itself defines which of the <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor②⓪">sensors</a> present on the device is
the <a data-link-type="dfn" href="#default-sensor" id="ref-for-default-sensor①">default sensor</a>.</p>
   <div class="example" id="example-6532f9b9">
    <a class="self-link" href="#example-6532f9b9"></a> Listening to the default accelerometer changes: 
<pre class="highlight"><c- a>let</c-> sensor <c- o>=</c-> <c- k>new</c-> Accelerometer<c- p>({</c-> frequency<c- o>:</c-> <c- mi>30</c-> <c- p>});</c->

sensor<c- p>.</c->onreading <c- o>=</c-> <c- p>()</c-> <c- p>=></c-> <c- p>{</c-> <c- p>...</c-> <c- p>}</c->
sensor<c- p>.</c->start<c- p>();</c->
</pre>
   </div>
   <p class="note" role="note"><span>Note:</span> extension to this specification may choose not to define a <a data-link-type="dfn" href="#default-sensor" id="ref-for-default-sensor②">default sensor</a> when doing so wouldn’t make sense.
For example, it does not make sense to explicitly define a default <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor②①">sensor</a> for geolocation <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type①⑦">sensor type</a> as the
implementation of its interface can use multiple backends.</p>
   <p>In cases where
multiple <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor②②">device sensors</a> corresponding to the same <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type①⑧">type</a> may coexist on the same device,
specification extension will have to
define ways to uniquely identify each one.</p>
   <div class="example" id="example-a71cf25b">
    <a class="self-link" href="#example-a71cf25b"></a> For example checking the pressure of the left rear tire: 
<pre class="highlight"><c- a>var</c-> sensor <c- o>=</c-> <c- k>new</c-> DirectTirePressureSensor<c- p>({</c-> position<c- o>:</c-> <c- u>"rear"</c-><c- p>,</c-> side<c- o>:</c-> <c- u>"left"</c-> <c- p>});</c->
sensor<c- p>.</c->onreading <c- o>=</c-> _ <c- p>=></c-> console<c- p>.</c->log<c- p>(</c->sensor<c- p>.</c->pressure<c- p>);</c->
sensor<c- p>.</c->start<c- p>();</c->
</pre>
   </div>
   <h3 class="heading settled" data-level="5.4" id="concepts-reading-change-threshold"><span class="secno">5.4. </span><span class="content">Reading change threshold</span><a class="self-link" href="#concepts-reading-change-threshold"></a></h3>
   <p>A <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor⑥">platform sensor</a> reports <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading②⑧">readings</a> to the user agent considering
the <a data-link-type="dfn" href="#reading-change-threshold" id="ref-for-reading-change-threshold">reading change threshold</a>.</p>
   <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="reading-change-threshold">reading change threshold</dfn> refers to a value which indicates whether or
not the changes in the <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor②③">device sensor</a>'s measurements were significant enough to
update the corresponding <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading②⑨">sensor readings</a>.</p>
   <p>The <a data-link-type="dfn" href="#reading-change-threshold" id="ref-for-reading-change-threshold①">threshold</a> value depends on the surrounding software and hardware
environment constraints, e.g., software power consumption optimizations or the underlying <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor②④">device sensor</a>'s accuracy.</p>
   <h3 class="heading settled" data-level="5.5" id="concepts-sampling-and-reporting-frequencies"><span class="secno">5.5. </span><span class="content">Sampling Frequency and Reporting Frequency</span><a class="self-link" href="#concepts-sampling-and-reporting-frequencies"></a></h3>
   <p>For the purpose of this specification, <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="sampling-frequency">sampling frequency</dfn> for a <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor⑦">platform sensor</a> is
defined as a frequency at which the user agent obtains <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading③⓪">sensor readings</a> from the underlying
platform.</p>
   <p>The user agent can request the underlying platform to deliver <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading③①">readings</a> at a certain
rate which is called <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="requested-sampling-frequency">requested sampling frequency</dfn>.</p>
   <p>The <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency③">sampling frequency</a> is equal to the <a data-link-type="dfn" href="#requested-sampling-frequency" id="ref-for-requested-sampling-frequency">requested sampling frequency</a> if the underlying platform
can support it.</p>
   <p>The <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency④">sampling frequency</a> differs from the <a data-link-type="dfn" href="#requested-sampling-frequency" id="ref-for-requested-sampling-frequency①">requested sampling frequency</a> in the following cases:</p>
   <ul>
    <li data-md>
     <p>the <a data-link-type="dfn" href="#requested-sampling-frequency" id="ref-for-requested-sampling-frequency②">requested sampling frequency</a> exceeds upper or lower <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency⑤">sampling frequency</a> bounds
 supported by the underlying platform.</p>
    <li data-md>
     <p>the <a data-link-type="dfn" href="#reading-change-threshold" id="ref-for-reading-change-threshold②">threshold</a> value is significant so that some of the <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor②⑤">device sensor</a>'s measurements are skipped and the <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading③②">sensor readings</a> are not updated.</p>
   </ul>
   <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="reporting-frequency">reporting frequency</dfn> for a concrete <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor②">Sensor</a></code> object is defined as a frequency at which
the "reading" event is <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire">fired</a> at this object.</p>
   <p>A <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor③">Sensor</a></code> object cannot access new <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading③③">readings</a> at a higher rate than the
user agent obtains them from the underlying platform, therefore the <a data-link-type="dfn" href="#reporting-frequency" id="ref-for-reporting-frequency">reporting frequency</a> can
never exceed the <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency⑥">sampling frequency</a> for the given <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type①⑨">sensor type</a>.</p>
   <h3 class="heading settled" data-level="5.6" id="concepts-can-expose-sensor-readings"><span class="secno">5.6. </span><span class="content">Conditions to expose sensor readings</span><a class="self-link" href="#concepts-can-expose-sensor-readings"></a></h3>
   <p>The user agent must verify that all <a data-link-type="dfn" href="#mandatory-conditions" id="ref-for-mandatory-conditions">mandatory conditions</a> are satisfied to ensure it <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="can-expose-sensor-readings">can expose sensor readings</dfn> to the <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor④">Sensor</a></code> objects of a certain <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type②⓪">type</a> that belong to a certain <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document②">active document</a>.</p>
   <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="mandatory-conditions">mandatory conditions</dfn> are the following:</p>
   <ul>
    <li data-md>
     <p>The given document is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-document" id="ref-for-responsible-document">responsible document</a> of a <a data-link-type="dfn" href="https://w3c.github.io/webappsec-secure-contexts/#secure-contexts" id="ref-for-secure-contexts①">secure context</a>.</p>
    <li data-md>
     <p>For each <a data-link-type="dfn" href="https://www.w3.org/TR/permissions/#enumdef-permissionname" id="ref-for-enumdef-permissionname">permission name</a> from the <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type②①">sensor type</a>'s associated <a data-link-type="dfn" href="#sensor-permission-names" id="ref-for-sensor-permission-names">sensor permission names</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set">set</a>, the corresponding permission’s <a data-link-type="dfn" href="https://www.w3.org/TR/permissions/#permission-state" id="ref-for-permission-state">state</a> is "granted".</p>
    <li data-md>
     <p><a data-link-type="dfn" href="https://www.w3.org/TR/page-visibility-2/#dom-visibilitystate" id="ref-for-dom-visibilitystate">Visibility state</a> of the document is "visible".</p>
    <li data-md>
     <p>The document is <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#should-request-be-allowed-to-use-feature" id="ref-for-should-request-be-allowed-to-use-feature①">allowed to use</a> all the <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature①">policy-controlled features</a> associated
 with the given <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type②②">sensor type</a>.</p>
    <li data-md>
     <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#currently-focused-area-of-a-top-level-browsing-context" id="ref-for-currently-focused-area-of-a-top-level-browsing-context①">Currently focused area</a> belongs to a document whose origin is <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin-domain" id="ref-for-same-origin-domain①">same origin-domain</a> with the origin of the given <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document③">active document</a>.</p>
    <li data-md>
     <p><dfn data-dfn-type="dfn" data-noexport id="specific-conditions">Specific conditions<a class="self-link" href="#specific-conditions"></a></dfn>: The <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification①">extension specifications</a> that add new <a data-link-type="dfn" href="#mandatory-conditions" id="ref-for-mandatory-conditions①">conditions</a> hook into this specification at this point.</p>
   </ul>
   <p class="note" role="note"><span>Note:</span> In order to release hardware resources, the user agent can request underlying <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor⑧">platform sensor</a> to suspend notifications about newly available readings until it <a data-link-type="dfn" href="#can-expose-sensor-readings" id="ref-for-can-expose-sensor-readings">can expose sensor readings</a>.</p>
   <h2 class="heading settled" data-level="6" id="model"><span class="secno">6. </span><span class="content">Model</span><a class="self-link" href="#model"></a></h2>
   <h3 class="heading settled" data-level="6.1" id="model-sensor-type"><span class="secno">6.1. </span><span class="content">Sensor Type</span><a class="self-link" href="#model-sensor-type"></a></h3>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="sensor-type">sensor type</dfn> has one or more associated <a data-link-type="dfn" href="#extension-sensor-interface" id="ref-for-extension-sensor-interface">extension sensor interfaces</a>.</p>
   <p>A <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type②③">sensor type</a> has a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set①">set</a> of <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="associated-sensors">associated sensors</dfn>.</p>
   <p>A <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type②④">sensor type</a> may have a <a data-link-type="dfn" href="#default-sensor" id="ref-for-default-sensor③">default sensor</a>.</p>
   <p>A <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type②⑤">sensor type</a> has a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-is-empty" id="ref-for-list-is-empty">nonempty</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set②">set</a> of associated <a data-link-type="dfn" href="https://www.w3.org/TR/permissions/#enumdef-permissionname" id="ref-for-enumdef-permissionname①">permission names</a> referred to as <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="sensor-permission-names">sensor permission names</dfn>.</p>
   <p class="note" role="note"><span>Note:</span> multiple <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type②⑥">sensor types</a> may share the same <a data-link-type="dfn" href="https://www.w3.org/TR/permissions/#enumdef-permissionname" id="ref-for-enumdef-permissionname②">permission name</a>.</p>
   <p>A <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type②⑦">sensor type</a> has a <a data-link-type="dfn" href="https://w3c.github.io/permissions/#permission-revocation-algorithm" id="ref-for-permission-revocation-algorithm">permission revocation algorithm</a>.</p>
   <div class="algorithm" data-algorithm="generic sensor permission revocation algorithm">
    <p>To invoke the <dfn data-dfn-type="dfn" data-lt="generic sensor permission revocation algorithm" data-noexport id="generic-sensor-permission-revocation-algorithm">permission revocation algorithm<a class="self-link" href="#generic-sensor-permission-revocation-algorithm"></a></dfn> with <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#enumdef-permissionname" id="ref-for-enumdef-permissionname③">PermissionName</a></code> <var>permission_name</var>, run the following steps:</p>
    <ol>
     <li data-md>
      <p>For each <var>sensor_type</var> whose <a data-link-type="dfn" href="#sensor-permission-names" id="ref-for-sensor-permission-names①">permission names</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-contain" id="ref-for-list-contain">contains</a> <var>permission_name</var>:</p>
      <ol>
       <li data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate">For each</a> <var>sensor</var> in <var>sensor_type</var>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set③">set</a> of <a data-link-type="dfn" href="#associated-sensors" id="ref-for-associated-sensors">associated sensors</a>,</p>
        <ol>
         <li data-md>
          <p>Invoke <a data-link-type="dfn" href="#revoke-sensor-permission" id="ref-for-revoke-sensor-permission">revoke sensor permission</a> with <var>sensor</var> as argument.</p>
        </ol>
      </ol>
    </ol>
   </div>
   <p>A <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type②⑧">sensor type</a> has a <a data-link-type="dfn" href="https://wicg.github.io/permissions-request/#permission-request-algorithm" id="ref-for-permission-request-algorithm①">permission request algorithm</a>.</p>
   <p>A <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type②⑨">sensor type</a> has a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-is-empty" id="ref-for-list-is-empty①">nonempty</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set④">set</a> of associated <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature②">policy-controlled feature</a> tokens referred to as <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="sensor-feature-names">sensor feature names</dfn>.</p>
   <h3 class="heading settled" data-level="6.2" id="model-sensor"><span class="secno">6.2. </span><span class="content">Sensor</span><a class="self-link" href="#model-sensor"></a></h3>
   <p>The current <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context①">browsing context</a>'s <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor⑨">platform sensor</a> has an associated <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set⑤">set</a> of <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="activated-sensor-objects">activated sensor objects</dfn>, which is initially <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-is-empty" id="ref-for-list-is-empty②">empty</a> and an
associated <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="latest-reading">latest reading</dfn> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map">map</a>, which holds the latest available <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading③④">sensor readings</a>.</p>
   <p class="note" role="note"><span>Note:</span> User agents can share the <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading">latest reading</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map①">map</a> and
the <a data-link-type="dfn" href="#activated-sensor-objects" id="ref-for-activated-sensor-objects">activated sensor objects</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set⑥">set</a> between different <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context②">contexts</a> only if the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#origin-2" id="ref-for-origin-2">origins</a> of these contexts' <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document④">active documents</a> are <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin-domain" id="ref-for-same-origin-domain②">same origin-domain</a>.</p>
   <p>Any time a new <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading③⑤">sensor reading</a> for a <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor①⓪">platform sensor</a> is obtained and if the user agent <a data-link-type="dfn" href="#can-expose-sensor-readings" id="ref-for-can-expose-sensor-readings①">can expose sensor readings</a> to the current <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context③">browsing context</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document⑤">active document</a>,
the user agent invokes <a data-link-type="dfn" href="#update-latest-reading" id="ref-for-update-latest-reading">update latest reading</a> with the <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor①①">platform sensor</a> and
the <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading③⑥">sensor reading</a> as arguments.</p>
   <p>The <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading①">latest reading</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map②">map</a> contains an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-entry" id="ref-for-map-entry">entry</a> whose <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-key" id="ref-for-map-key">key</a> is
"timestamp" and whose <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-value" id="ref-for-map-value">value</a> is a high resolution timestamp that estimates the <a data-link-type="dfn" href="#reading-timestamp" id="ref-for-reading-timestamp②">reading timestamp</a> expressed in milliseconds since the <a data-link-type="dfn" href="https://www.w3.org/TR/hr-time-2/#dfn-time-origin" id="ref-for-dfn-time-origin">time origin</a>.</p>
   <p class="note" role="note"><span>Note:</span> The accuracy of the <a data-link-type="dfn" href="#reading-timestamp" id="ref-for-reading-timestamp③">reading timestamp</a> estimate depends on the underlying
platform interfaces that expose it.</p>
   <p>The <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading②">latest reading</a>["timestamp"] is initially set to null,
unless the <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading③">latest reading</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map③">map</a> caches a previous <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading③⑦">reading</a>.</p>
   <p>The other <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-entry" id="ref-for-map-entry①">entries</a> of the <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading④">latest reading</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map④">map</a> hold the values of the different quantities measured by the <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor①②">platform sensor</a>.
The <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-key" id="ref-for-map-key①">keys</a> of these <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-entry" id="ref-for-map-entry②">entries</a> must match
the <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-attribute" id="ref-for-dfn-attribute">attribute</a> <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-identifier" id="ref-for-dfn-identifier">identifier</a> defined by the <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type③⓪">sensor type</a>'s
associated <a data-link-type="dfn" href="#extension-sensor-interface" id="ref-for-extension-sensor-interface①">extension sensor interface</a>.
The return value of the <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-attribute" id="ref-for-dfn-attribute①">attribute</a> getter is
easily obtained by invoking <a data-link-type="dfn" href="#get-value-from-latest-reading" id="ref-for-get-value-from-latest-reading">get value from latest reading</a> with the object implementing the <a data-link-type="dfn" href="#extension-sensor-interface" id="ref-for-extension-sensor-interface②">extension sensor interface</a> and the <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-attribute" id="ref-for-dfn-attribute②">attribute</a> <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-identifier" id="ref-for-dfn-identifier①">identifier</a> as arguments.</p>
   <p>The <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-value" id="ref-for-map-value①">value</a> of all <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading⑤">latest reading</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-entry" id="ref-for-map-entry③">entries</a> is initially set to null.</p>
   <p>A <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor①③">platform sensor</a> has an associated <a data-link-type="dfn" href="#requested-sampling-frequency" id="ref-for-requested-sampling-frequency③">requested sampling frequency</a> which is initially null.</p>
   <p>For a non<a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-is-empty" id="ref-for-list-is-empty③">empty</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set⑦">set</a> of <a data-link-type="dfn" href="#activated-sensor-objects" id="ref-for-activated-sensor-objects①">activated sensor objects</a> the <a data-link-type="dfn" href="#requested-sampling-frequency" id="ref-for-requested-sampling-frequency④">requested sampling frequency</a> is equal to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="optimal-sampling-frequency">optimal sampling frequency</dfn>, which is estimated
by the user agent taking into account <code class="idl"><a data-link-type="idl" href="#dom-sensor-frequency-slot" id="ref-for-dom-sensor-frequency-slot">provided frequencies</a></code> of <a data-link-type="dfn" href="#activated-sensor-objects" id="ref-for-activated-sensor-objects②">activated</a> <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor⑤">Sensors</a></code> and <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency⑦">sampling frequency</a> bounds
defined by the underlying platform.</p>
   <p class="note" role="note"><span>Note:</span> For example, the user agent may estimate <a data-link-type="dfn" href="#optimal-sampling-frequency" id="ref-for-optimal-sampling-frequency">optimal sampling frequency</a> as a Least Common
Denominator (LCD) for a set of <code class="idl"><a data-link-type="idl" href="#dom-sensor-frequency-slot" id="ref-for-dom-sensor-frequency-slot①">provided frequencies</a></code> capped
by <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency⑧">sampling frequency</a> bounds defined by the underlying platform.</p>
   <div class="example" id="example-c4bd9af5">
    <a class="self-link" href="#example-c4bd9af5"></a> 
    <p>This example illustrates a possible implementation of the described <a href="#model">Model</a>.</p>
    <p>In the diagram below several <a data-link-type="dfn" href="#activated-sensor-objects" id="ref-for-activated-sensor-objects③">activated</a> <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor⑥">Sensor</a></code> objects from two
different <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context④">browsing contexts</a> interact with a single <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor②⑥">device sensor</a>.</p>
    <p><img alt="Generic Sensor Model" src="images/generic_sensor_model.png" srcset="images/generic_sensor_model.svg"></p>
    <p>The <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor⑦">Sensor</a></code> object in "idle" <a href="#sensor-lifecycle">state</a> is not among the <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor①④">platform sensor</a>'s <a data-link-type="dfn" href="#activated-sensor-objects" id="ref-for-activated-sensor-objects④">activated sensor objects</a> and thus it does not interact with the <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor②⑦">device sensor</a>.</p>
    <p>In this example there is a <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor①⑤">platform sensor</a> instance per <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context⑤">browsing context</a>.</p>
    <p>The <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading⑥">latest reading</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map⑤">map</a> is shared between <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor⑧">Sensor</a></code> objects from the
same <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context⑥">context</a> and is updated at rate equal to <a data-link-type="dfn" href="#requested-sampling-frequency" id="ref-for-requested-sampling-frequency⑤">requested sampling frequency</a> of the corresponding <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor①⑥">platform sensor</a>.</p>
   </div>
   <h2 class="heading settled" data-level="7" id="api"><span class="secno">7. </span><span class="content">API</span><a class="self-link" href="#api"></a></h2>
   <h3 class="heading settled" data-level="7.1" id="the-sensor-interface"><span class="secno">7.1. </span><span class="content">The Sensor Interface</span><a class="self-link" href="#the-sensor-interface"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed"><c- g>Exposed</c-></a>=(<c- n>DedicatedWorker</c->, <c- n>Window</c->)]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="sensor"><code><c- g>Sensor</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Sensor" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-sensor-activated"><code><c- g>activated</c-></code></dfn>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Sensor" data-dfn-type="attribute" data-export data-readonly data-type="boolean" id="dom-sensor-hasreading"><code><c- g>hasReading</c-></code></dfn>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/hr-time-2/#dom-domhighrestimestamp" id="ref-for-dom-domhighrestimestamp"><c- n>DOMHighResTimeStamp</c-></a>? <dfn class="dfn-paneled idl-code" data-dfn-for="Sensor" data-dfn-type="attribute" data-export data-readonly data-type="DOMHighResTimeStamp?" id="dom-sensor-timestamp"><code><c- g>timestamp</c-></code></dfn>;
  <c- b>void</c-> <dfn class="dfn-paneled idl-code" data-dfn-for="Sensor" data-dfn-type="method" data-export data-lt="start()" id="dom-sensor-start"><code><c- g>start</c-></code></dfn>();
  <c- b>void</c-> <dfn class="dfn-paneled idl-code" data-dfn-for="Sensor" data-dfn-type="method" data-export data-lt="stop()" id="dom-sensor-stop"><code><c- g>stop</c-></code></dfn>();
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler"><c- n>EventHandler</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Sensor" data-dfn-type="attribute" data-export data-type="EventHandler" id="dom-sensor-onreading"><code><c- g>onreading</c-></code></dfn>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler①"><c- n>EventHandler</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Sensor" data-dfn-type="attribute" data-export data-type="EventHandler" id="dom-sensor-onactivate"><code><c- g>onactivate</c-></code></dfn>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler②"><c- n>EventHandler</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Sensor" data-dfn-type="attribute" data-export data-type="EventHandler" id="dom-sensor-onerror"><code><c- g>onerror</c-></code></dfn>;
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-sensoroptions"><code><c- g>SensorOptions</c-></code></dfn> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-double" id="ref-for-idl-double"><c- b>double</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="SensorOptions" data-dfn-type="dict-member" data-export data-type="double " id="dom-sensoroptions-frequency"><code><c- g>frequency</c-></code></dfn>;
};
</pre>
   <p>A <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor⑨">Sensor</a></code> object has an associated <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor①⑦">platform sensor</a>.</p>
   <p>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source">task source</a> for the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task">tasks</a> mentioned in this specification is the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="sensor-task-source">sensor task source</dfn>.</p>
   <div class="example" id="example-c4eab8e2">
    <a class="self-link" href="#example-c4eab8e2"></a> In the following example, firstly, we check whether the user agent has permission to access <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading③⑧">sensor readings</a>, then we construct accelerometer sensor and add <a data-link-type="dfn" href="https://dom.spec.whatwg.org#concept-event-listener" id="ref-for-concept-event-listener">event listeners</a> to get <a data-link-type="dfn" href="https://dom.spec.whatwg.org#concept-event" id="ref-for-concept-event">events</a> for <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor①⑧">platform sensor</a> activation,
    error conditions and notifications about newly available <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading③⑨">sensor readings</a>. The example
    measures and logs maximum total acceleration of a device hosting the <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor①⑨">platform sensor</a>. 
    <p>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type">event handler event types</a> for the corresponding <a href="#the-sensor-interface"> Sensor Interface</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers">event handler</a> attributes are defined in <a href="#event-handlers">Event handlers</a> section.</p>
<pre class="highlight">navigator<c- p>.</c->permissions<c- p>.</c->query<c- p>({</c-> name<c- o>:</c-> <c- t>'accelerometer'</c-> <c- p>}).</c->then<c- p>(</c->result <c- p>=></c-> <c- p>{</c->
    <c- k>if</c-> <c- p>(</c->result<c- p>.</c->state <c- o>===</c-> <c- t>'denied'</c-><c- p>)</c-> <c- p>{</c->
        console<c- p>.</c->log<c- p>(</c-><c- t>'Permission to use accelerometer sensor is denied.'</c-><c- p>);</c->
        <c- k>return</c-><c- p>;</c->
    <c- p>}</c->

    <c- a>let</c-> acl <c- o>=</c-> <c- k>new</c-> Accelerometer<c- p>({</c->frequency<c- o>:</c-> <c- mi>30</c-><c- p>});</c->
    <c- a>let</c-> max_magnitude <c- o>=</c-> <c- mi>0</c-><c- p>;</c->
    acl<c- p>.</c->addEventListener<c- p>(</c-><c- t>'activate'</c-><c- p>,</c-> <c- p>()</c-> <c- p>=></c-> console<c- p>.</c->log<c- p>(</c-><c- t>'Ready to measure.'</c-><c- p>));</c->
    acl<c- p>.</c->addEventListener<c- p>(</c-><c- t>'error'</c-><c- p>,</c-> error <c- p>=></c-> console<c- p>.</c->log<c- p>(</c-><c- sb>`Error: </c-><c- si>${</c->error<c- p>.</c->name<c- si>}</c-><c- sb>`</c-><c- p>));</c->
    acl<c- p>.</c->addEventListener<c- p>(</c-><c- t>'reading'</c-><c- p>,</c-> <c- p>()</c-> <c- p>=></c-> <c- p>{</c->
        <c- a>let</c-> magnitude <c- o>=</c-> Math<c- p>.</c->hypot<c- p>(</c->acl<c- p>.</c->x<c- p>,</c-> acl<c- p>.</c->y<c- p>,</c-> acl<c- p>.</c->z<c- p>);</c->
        <c- k>if</c-> <c- p>(</c->magnitude <c- o>></c-> max_magnitude<c- p>)</c-> <c- p>{</c->
            max_magnitude <c- o>=</c-> magnitude<c- p>;</c->
            console<c- p>.</c->log<c- p>(</c-><c- sb>`Max magnitude: </c-><c- si>${</c->max_magnitude<c- si>}</c-><c- sb> m/s2`</c-><c- p>);</c->
        <c- p>}</c->
    <c- p>});</c->
    acl<c- p>.</c->start<c- p>();</c->
<c- p>});</c->
</pre>
   </div>
   <h4 class="heading settled" data-level="7.1.1" id="sensor-lifecycle"><span class="secno">7.1.1. </span><span class="content">Sensor lifecycle</span><a class="self-link" href="#sensor-lifecycle"></a></h4>
   <svg height="79pt" viewBox="0.00 0.00 351.00 78.51" width="351pt" xmlns="http://www.w3.org/2000/svg">
    <g class="graph" transform="scale(1 1) rotate(0) translate(4 74.5122)">
     <title>Sensor lifecycle</title>
     <a href="#dom-sensor-state-slot">
      <g class="node">
       <title>idle</title>
       <path d="M96.997,-64C96.997,-64 66.997,-64 66.997,-64 60.997,-64 54.997,-58 54.997,-52 54.997,-52 54.997,-36 54.997,-36 54.997,-30 60.997,-24 66.997,-24 66.997,-24 96.997,-24 96.997,-24 102.997,-24 108.997,-30 108.997,-36 108.997,-36 108.997,-52 108.997,-52 108.997,-58 102.997,-64 96.997,-64" fill="white" stroke="black"></path>
       <text text-anchor="middle" transform="translate(0,-2)" x="81.997" y="-41.2">idle</text>
      </g>
     </a>
     <a href="#dom-sensor-state-slot">
      <g class="node">
       <title>activating</title>
       <path d="M214.997,-64C214.997,-64 156.997,-64 156.997,-64 150.997,-64 144.997,-58 144.997,-52 144.997,-52 144.997,-36 144.997,-36 144.997,-30 150.997,-24 156.997,-24 156.997,-24 214.997,-24 214.997,-24 220.997,-24 226.997,-30 226.997,-36 226.997,-36 226.997,-52 226.997,-52 226.997,-58 220.997,-64 214.997,-64" fill="white" stroke="black"></path>
       <text text-anchor="middle" transform="translate(0,-2)" x="185.997" y="-41.2">activating</text>
      </g>
     </a>
     <g class="edge">
      <title>idle->activating</title>
      <path d="M109,-38.0296C116.891,-37.4946 125.842,-37.2349 134.762,-37.2507" fill="none" stroke="black"></path>
      <polygon fill="black" points="144.762,-37.3855 134.702,-41.7502 139.762,-37.318 134.763,-37.2506 134.763,-37.2506 134.763,-37.2506 139.762,-37.318 134.823,-32.751 144.762,-37.3855 144.762,-37.3855" stroke="black"></polygon>
      <text text-anchor="middle" transform="translate(0,-4)" x="133.576" y="-20.9121">start()</text>
      <a href="#sensor-start">
       <text text-anchor="middle" transform="translate(0,-4)" x="133.576" y="-20.9121">start()</text>
      </a>
     </g>
     <g class="edge">
      <title>activating->idle</title>
      <path d="M144.762,-50.6145C136.302,-50.8304 127.428,-50.7883 119.129,-50.4883" fill="none" stroke="black"></path>
      <polygon fill="black" points="109,-49.9704 119.217,-45.987 113.993,-50.2258 118.987,-50.4811 118.987,-50.4811 118.987,-50.4811 113.993,-50.2258 118.757,-54.9753 109,-49.9704 109,-49.9704" stroke="black"></polygon>
      <text text-anchor="middle" transform="translate(0,-4)" x="119.656" y="-59.3122">
       <a href="#sensor-onerror">onerror</a>
      </text>
     </g>
     <a href="#dom-sensor-state-slot">
      <g class="node">
       <title>activated</title>
       <path d="M330.997,-40C330.997,-40 274.997,-40 274.997,-40 268.997,-40 262.997,-34 262.997,-28 262.997,-28 262.997,-12 262.997,-12 262.997,-6 268.997,-0 274.997,-0 274.997,-0 330.997,-0 330.997,-0 336.997,-0 342.997,-6 342.997,-12 342.997,-12 342.997,-28 342.997,-28 342.997,-34 336.997,-40 330.997,-40" fill="white" stroke="black"></path>
       <text text-anchor="middle" transform="translate(0,-2)" x="302.997" y="-17.2">activated</text>
      </g>
     </a>
     <g class="edge">
      <title>activating->activated</title>
      <path d="M227.218,-35.606C235.505,-33.8766 244.319,-32.037 252.881,-30.2504" fill="none" stroke="black"></path>
      <polygon fill="black" points="262.767,-28.1871 253.898,-34.6352 257.873,-29.2086 252.978,-30.2301 252.978,-30.2301 252.978,-30.2301 257.873,-29.2086 252.059,-25.825 262.767,-28.1871 262.767,-28.1871" stroke="black"></polygon>
     </g>
     <g class="edge">
      <title>activated->idle</title>
      <path d="M262.74,-17.3829C244.593,-16.1731 226.997,-15 226.997,-15 226.997,-15 144.997,-15 144.997,-15 144.997,-15 132.341,-20.9199 118.465,-27.4103" fill="none" stroke="black"></path>
      <polygon fill="black" points="109.291,-31.7014 116.442,-23.3883 113.82,-29.5829 118.349,-27.4645 118.349,-27.4645 118.349,-27.4645 113.82,-29.5829 120.255,-31.5406 109.291,-31.7014 109.291,-31.7014" stroke="black"></polygon>
      <text text-anchor="middle" transform="translate(0,-4)" x="200" y="5">
       <a href="#sensor-stop">stop()</a>
        / 
       <a href="#sensor-onerror">onerror</a>
      </text>
     </g>
     <g class="node">
      <title>start</title>
      <ellipse cx="11.997" cy="-44" fill="black" rx="7" ry="7" stroke="black"></ellipse>
     </g>
     <g class="edge">
      <title>start->idle</title>
      <path d="M19.2724,-44C25.2754,-44 34.8461,-44 44.6767,-44" fill="none" stroke="black"></path>
      <polygon fill="black" points="54.8766,-44 44.8767,-48.5001 49.8766,-44 44.8766,-44.0001 44.8766,-44.0001 44.8766,-44.0001 49.8766,-44 44.8766,-39.5001 54.8766,-44 54.8766,-44" stroke="black"></polygon>
      <a href="#extension-sensor-interface">
       <text text-anchor="middle" transform="translate(0,-4)" x="29.5" y="-52.1333">construct</text>
      </a>
     </g>
    </g>
   </svg>
   <p class="note" role="note"><span>Note:</span> the nodes in the diagram above represent the states of a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor①⓪">Sensor</a></code> object and they should not be
confused with the possible states of the underlying <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor②⓪">platform sensor</a> or <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor②⑧">device sensor</a>.</p>
   <h4 class="heading settled" data-level="7.1.2" id="sensor-garbage-collection"><span class="secno">7.1.2. </span><span class="content">Sensor garbage collection</span><a class="self-link" href="#sensor-garbage-collection"></a></h4>
   <p>A <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor①①">Sensor</a></code> object whose <code class="idl"><a data-link-type="idl" href="#dom-sensor-state-slot" id="ref-for-dom-sensor-state-slot">[[state]]</a></code> is "activating" must not be garbage collected
if there are any event listeners registered for "activated" events, "reading" events,
or "error" events.</p>
   <p>A <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor①②">Sensor</a></code> object whose <code class="idl"><a data-link-type="idl" href="#dom-sensor-state-slot" id="ref-for-dom-sensor-state-slot①">[[state]]</a></code> is "activated" must not be garbage collected
if there are any event listeners registered for "reading" events, or "error" events.</p>
   <p>When a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor①③">Sensor</a></code> object whose <code class="idl"><a data-link-type="idl" href="#dom-sensor-state-slot" id="ref-for-dom-sensor-state-slot②">[[state]]</a></code> is "activated" or "activating" is
garbage collected, the user agent must invoke <a data-link-type="dfn" href="#deactivate-a-sensor-object" id="ref-for-deactivate-a-sensor-object">deactivate a sensor object</a> with this object as argument.</p>
   <h4 class="heading settled" data-level="7.1.3" id="sensor-internal-slots"><span class="secno">7.1.3. </span><span class="content">Sensor internal slots</span><a class="self-link" href="#sensor-internal-slots"></a></h4>
   <p>Instances of <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor①④">Sensor</a></code> are created
with the internal slots described in the following table:</p>
   <p></p>
   <table class="def" id="sensor-slots">
    <thead>
     <tr>
      <th>Internal Slot
      <th>Description (non-normative)
    <tbody>
     <tr>
      <td><dfn class="dfn-paneled idl-code" data-dfn-for="Sensor" data-dfn-type="attribute" data-export id="dom-sensor-state-slot"><code>[[state]]</code></dfn>
      <td>The current state of the <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor①⑤">Sensor</a></code> object which is one of
                "idle",
                "activating", or
                "activated".
                It is initially "idle". 
     <tr>
      <td><dfn class="dfn-paneled idl-code" data-dfn-for="Sensor" data-dfn-type="attribute" data-export id="dom-sensor-frequency-slot"><code>[[frequency]]</code></dfn>
      <td>
       A double representing frequency in Hz that is used to calculate
                the <a data-link-type="dfn" href="#requested-sampling-frequency" id="ref-for-requested-sampling-frequency⑥">requested sampling frequency</a> for the associated <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor②①">platform sensor</a> and to define the upper bound of the <a data-link-type="dfn" href="#reporting-frequency" id="ref-for-reporting-frequency①">reporting frequency</a> for this <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor①⑥">Sensor</a></code> object. 
       <p>This slot holds the provided <code class="idl"><a data-link-type="idl" href="#dictdef-sensoroptions" id="ref-for-dictdef-sensoroptions">SensorOptions</a></code>.<code class="idl"><a class="idl-code" data-link-type="dict-member" href="#dom-sensoroptions-frequency" id="ref-for-dom-sensoroptions-frequency">frequency</a></code> value.
                It is initially unset.</p>
     <tr>
      <td><dfn class="dfn-paneled idl-code" data-dfn-for="Sensor" data-dfn-type="attribute" data-export id="dom-sensor-lasteventfiredat-slot"><code>[[lastEventFiredAt]]</code></dfn>
      <td>The high resolution timestamp of the latest <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading④⓪">sensor reading</a> that was sent to observers of the <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor①⑦">Sensor</a></code> object,
                expressed in milliseconds that passed since the <a data-link-type="dfn" href="https://www.w3.org/TR/hr-time-2/#dfn-time-origin" id="ref-for-dfn-time-origin①">time origin</a>.
                It is initially null. 
     <tr>
      <td><dfn class="dfn-paneled idl-code" data-dfn-for="Sensor" data-dfn-type="attribute" data-export id="dom-sensor-pendingreadingnotification-slot"><code>[[pendingReadingNotification]]</code></dfn>
      <td>A boolean which indicates whether the observers need to be
                notified after a new <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading④①">sensor reading</a> was reported.
                It is initially false.
   </table>
   <h4 class="heading settled" data-level="7.1.4" id="sensor-activated"><span class="secno">7.1.4. </span><span class="content">Sensor.activated</span><a class="self-link" href="#sensor-activated"></a></h4>
   <div class="algorithm" data-algorithm="is sensor activated">
    <p>The getter of the <code class="idl"><a class="idl-code" data-link-type="attribute" href="#dom-sensor-activated" id="ref-for-dom-sensor-activated">activated</a></code> attribute must run these steps:</p>
    <ol>
     <li data-md>
      <p>If <strong>this</strong>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-state-slot" id="ref-for-dom-sensor-state-slot③">[[state]]</a></code> is "activated",
  return true.</p>
     <li data-md>
      <p>Otherwise, return false.</p>
    </ol>
   </div>
   <h4 class="heading settled" data-level="7.1.5" id="sensor-has-reading"><span class="secno">7.1.5. </span><span class="content">Sensor.hasReading</span><a class="self-link" href="#sensor-has-reading"></a></h4>
   <div class="algorithm" data-algorithm="sensor has reading">
    <p>The getter of the <code class="idl"><a class="idl-code" data-link-type="attribute" href="#dom-sensor-hasreading" id="ref-for-dom-sensor-hasreading">hasReading</a></code> attribute must run these steps:</p>
    <ol>
     <li data-md>
      <p>Let <var>timestamp</var> be the result of invoking <a data-link-type="dfn" href="#get-value-from-latest-reading" id="ref-for-get-value-from-latest-reading①">get value from latest reading</a> with <strong>this</strong> and "timestamp" as arguments.</p>
     <li data-md>
      <p>If <var>timestamp</var> is not null, return true.</p>
     <li data-md>
      <p>Otherwise, return false.</p>
    </ol>
   </div>
   <h4 class="heading settled" data-level="7.1.6" id="sensor-timestamp"><span class="secno">7.1.6. </span><span class="content">Sensor.timestamp</span><a class="self-link" href="#sensor-timestamp"></a></h4>
   <p>The getter of the <code class="idl"><a class="idl-code" data-link-type="attribute" href="#dom-sensor-timestamp" id="ref-for-dom-sensor-timestamp">timestamp</a></code> attribute returns
the result of invoking <a data-link-type="dfn" href="#get-value-from-latest-reading" id="ref-for-get-value-from-latest-reading②">get value from latest reading</a> with <strong>this</strong> and "timestamp" as arguments. It represents a <a data-link-type="dfn" href="#reading-timestamp" id="ref-for-reading-timestamp④">reading timestamp</a>.</p>
   <h4 class="heading settled" data-level="7.1.7" id="sensor-start"><span class="secno">7.1.7. </span><span class="content">Sensor.start()</span><a class="self-link" href="#sensor-start"></a></h4>
   <div class="algorithm" data-algorithm="to start a sensor">
    <p>The <code class="idl"><a data-link-type="idl" href="#dom-sensor-start" id="ref-for-dom-sensor-start">start()</a></code> method must run these steps:</p>
    <ol>
     <li data-md>
      <p>Let <var>sensor_state</var> be the value of <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-state-slot" id="ref-for-dom-sensor-state-slot④">[[state]]</a></code>.</p>
     <li data-md>
      <p>If <var>sensor_state</var> is either "activating"
  or "activated", then return.</p>
     <li data-md>
      <p>Set <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-state-slot" id="ref-for-dom-sensor-state-slot⑤">[[state]]</a></code> to "activating".</p>
     <li data-md>
      <p>Run these sub-steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p>let <var>connected</var> be the result of invoking <a data-link-type="dfn" href="#connect-to-sensor" id="ref-for-connect-to-sensor">connect to sensor</a> with <var>sensor_instance</var> as argument.</p>
       <li data-md>
        <p>If <var>connected</var> is false, then</p>
        <ol>
         <li data-md>
          <p>Let <var>e</var> be the result of <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-create-exception" id="ref-for-dfn-create-exception">creating</a> a
  "<code class="idl"><a class="idl-code" data-link-type="exception" href="https://heycam.github.io/webidl/#notreadableerror" id="ref-for-notreadableerror">NotReadableError</a></code>" <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException">DOMException</a></code>.</p>
         <li data-md>
          <p>Queue a task to run <a data-link-type="dfn" href="#notify-error" id="ref-for-notify-error">notify error</a> with <var>e</var> and <var>sensor_instance</var> as arguments.</p>
         <li data-md>
          <p>Return.</p>
        </ol>
       <li data-md>
        <p>Let <var>permission_state</var> be the result of invoking <a data-link-type="dfn" href="#request-sensor-access" id="ref-for-request-sensor-access">request sensor access</a> with <var>sensor_instance</var> as argument.</p>
       <li data-md>
        <p>If <var>permission_state</var> is "granted",</p>
        <ol>
         <li data-md>
          <p>Invoke <a data-link-type="dfn" href="#activate-a-sensor-object" id="ref-for-activate-a-sensor-object">activate a sensor object</a> with <var>sensor_instance</var> as argument.</p>
        </ol>
       <li data-md>
        <p>Otherwise, if <var>permission_state</var> is "denied",</p>
        <ol>
         <li data-md>
          <p>let <var>e</var> be the result of <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-create-exception" id="ref-for-dfn-create-exception①">creating</a> a "<code class="idl"><a class="idl-code" data-link-type="exception" href="https://heycam.github.io/webidl/#notallowederror" id="ref-for-notallowederror">NotAllowedError</a></code>" <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException①">DOMException</a></code>.</p>
         <li data-md>
          <p>Queue a task to run <a data-link-type="dfn" href="#notify-error" id="ref-for-notify-error①">notify error</a> with <var>e</var> and <var>sensor_instance</var> as arguments.</p>
        </ol>
      </ol>
    </ol>
   </div>
   <h4 class="heading settled" data-level="7.1.8" id="sensor-stop"><span class="secno">7.1.8. </span><span class="content">Sensor.stop()</span><a class="self-link" href="#sensor-stop"></a></h4>
   <div class="algorithm" data-algorithm="to stop a sensor">
    <p>The <code class="idl"><a data-link-type="idl" href="#dom-sensor-stop" id="ref-for-dom-sensor-stop">stop()</a></code> method must run these steps:</p>
    <ol>
     <li data-md>
      <p>If <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-state-slot" id="ref-for-dom-sensor-state-slot⑥">[[state]]</a></code> is "idle", then return.</p>
     <li data-md>
      <p>Set <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-state-slot" id="ref-for-dom-sensor-state-slot⑦">[[state]]</a></code> to "idle".</p>
     <li data-md>
      <p>Run these sub-steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p>Invoke <a data-link-type="dfn" href="#deactivate-a-sensor-object" id="ref-for-deactivate-a-sensor-object①">deactivate a sensor object</a> with <var>sensor_instance</var> as argument.</p>
      </ol>
    </ol>
   </div>
   <h4 class="heading settled" data-level="7.1.9" id="sensor-onreading"><span class="secno">7.1.9. </span><span class="content">Sensor.onreading</span><a class="self-link" href="#sensor-onreading"></a></h4>
   <p><code class="idl"><a data-link-type="idl" href="#dom-sensor-onreading" id="ref-for-dom-sensor-onreading">onreading</a></code> is an <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler③">EventHandler</a></code> which is called
to notify that new <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading④②">reading</a> is available.</p>
   <h4 class="heading settled" data-level="7.1.10" id="sensor-onactivate"><span class="secno">7.1.10. </span><span class="content">Sensor.onactivate</span><a class="self-link" href="#sensor-onactivate"></a></h4>
   <p><code class="idl"><a data-link-type="idl" href="#dom-sensor-onactivate" id="ref-for-dom-sensor-onactivate">onactivate</a></code> is an <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler④">EventHandler</a></code> which is called when <strong>this</strong>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-state-slot" id="ref-for-dom-sensor-state-slot⑧">[[state]]</a></code> transitions from "activating" to "activated".</p>
   <h4 class="heading settled" data-level="7.1.11" id="sensor-onerror"><span class="secno">7.1.11. </span><span class="content">Sensor.onerror</span><a class="self-link" href="#sensor-onerror"></a></h4>
   <p><code class="idl"><a data-link-type="idl" href="#dom-sensor-onerror" id="ref-for-dom-sensor-onerror">onerror</a></code> is an <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑤">EventHandler</a></code> which is called whenever
an <a data-link-type="dfn">exception</a> cannot be handled synchronously.</p>
   <h4 class="heading settled" data-level="7.1.12" id="event-handlers"><span class="secno">7.1.12. </span><span class="content">Event handlers</span><a class="self-link" href="#event-handlers"></a></h4>
   <p>The following are the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers①">event handlers</a> (and their corresponding <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type①">event handler event types</a>)
that must be supported as attributes by the objects implementing the <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor①⑧">Sensor</a></code> interface:</p>
   <table class="def">
    <thead>
     <tr>
      <th>event handler
      <th>event handler event type
    <tbody>
     <tr>
      <td><strong><code>onreading</code></strong>
      <td><code>reading</code>
     <tr>
      <td><strong><code>onactivate</code></strong>
      <td><code>activate</code>
     <tr>
      <td><strong><code>onerror</code></strong>
      <td><code>error</code>
   </table>
   <h3 class="heading settled" data-level="7.2" id="the-sensor-error-event-interface"><span class="secno">7.2. </span><span class="content">The SensorErrorEvent Interface</span><a class="self-link" href="#the-sensor-error-event-interface"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①"><c- g>Exposed</c-></a>=(<c- n>DedicatedWorker</c->, <c- n>Window</c->)]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="sensorerrorevent"><code><c- g>SensorErrorEvent</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event"><c- n>Event</c-></a> {
  <dfn class="idl-code" data-dfn-for="SensorErrorEvent" data-dfn-type="constructor" data-export data-lt="SensorErrorEvent(type, errorEventInitDict)|constructor(type, errorEventInitDict)" id="dom-sensorerrorevent-sensorerrorevent"><code><c- g>constructor</c-></code><a class="self-link" href="#dom-sensorerrorevent-sensorerrorevent"></a></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="SensorErrorEvent/SensorErrorEvent(type, errorEventInitDict), SensorErrorEvent/constructor(type, errorEventInitDict)" data-dfn-type="argument" data-export id="dom-sensorerrorevent-sensorerrorevent-type-erroreventinitdict-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-sensorerrorevent-sensorerrorevent-type-erroreventinitdict-type"></a></dfn>, <a class="n" data-link-type="idl-name" href="#dictdef-sensorerroreventinit" id="ref-for-dictdef-sensorerroreventinit"><c- n>SensorErrorEventInit</c-></a> <dfn class="idl-code" data-dfn-for="SensorErrorEvent/SensorErrorEvent(type, errorEventInitDict), SensorErrorEvent/constructor(type, errorEventInitDict)" data-dfn-type="argument" data-export id="dom-sensorerrorevent-sensorerrorevent-type-erroreventinitdict-erroreventinitdict"><code><c- g>errorEventInitDict</c-></code><a class="self-link" href="#dom-sensorerrorevent-sensorerrorevent-type-erroreventinitdict-erroreventinitdict"></a></dfn>);
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException②"><c- n>DOMException</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="SensorErrorEvent" data-dfn-type="attribute" data-export data-readonly data-type="DOMException" id="dom-sensorerrorevent-error"><code><c- g>error</c-></code></dfn>;
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-sensorerroreventinit"><code><c- g>SensorErrorEventInit</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit"><c- n>EventInit</c-></a> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException③"><c- n>DOMException</c-></a> <dfn class="idl-code" data-dfn-for="SensorErrorEventInit" data-dfn-type="dict-member" data-export data-type="DOMException " id="dom-sensorerroreventinit-error"><code><c- g>error</c-></code><a class="self-link" href="#dom-sensorerroreventinit-error"></a></dfn>;
};
</pre>
   <h4 class="heading settled" data-level="7.2.1" id="sensor-error-event-error"><span class="secno">7.2.1. </span><span class="content">SensorErrorEvent.error</span><a class="self-link" href="#sensor-error-event-error"></a></h4>
   <p>Gets the <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException④">DOMException</a></code> object passed to <code class="idl"><a data-link-type="idl" href="#dictdef-sensorerroreventinit" id="ref-for-dictdef-sensorerroreventinit①">SensorErrorEventInit</a></code>.</p>
   <h2 class="heading settled" data-level="8" id="abstract-operations"><span class="secno">8. </span><span class="content">Abstract Operations</span><a class="self-link" href="#abstract-operations"></a></h2>
   <h3 class="heading settled" data-dfn-type="dfn" data-export data-level="8.1" data-lt="Initialize a sensor object" id="initialize-a-sensor-object"><span class="secno">8.1. </span><span class="content">Initialize a sensor object</span><a class="self-link" href="#initialize-a-sensor-object"></a></h3>
   <div class="algorithm" data-algorithm="initialize a sensor object">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor_instance</var>, a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor①⑨">Sensor</a></code> object.</p>
     <dd data-md>
      <p><var>options</var>, a <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary" id="ref-for-dfn-dictionary">dictionary</a> object.</p>
     <dt data-md>output
     <dd data-md>
      <p>None</p>
    </dl>
    <ol>
     <li data-md>
      <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-iterate" id="ref-for-map-iterate">For each</a> <var>key</var> → <var>value</var> of <var>options</var></p>
      <ol>
       <li data-md>
        <p>If the associated <a data-link-type="dfn" href="#supported-sensor-options" id="ref-for-supported-sensor-options">supported sensor options</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-contain" id="ref-for-list-contain①">does not contain</a> <var>key</var></p>
        <ol>
         <li data-md>
          <p><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw">Throw</a> "<code class="idl"><a class="idl-code" data-link-type="exception" href="https://heycam.github.io/webidl/#notsupportederror" id="ref-for-notsupportederror">NotSupportedError</a></code>" <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException⑤">DOMException</a></code>.</p>
        </ol>
      </ol>
     <li data-md>
      <p>If <var>options</var>.<code class="idl"><a class="idl-code" data-link-type="dict-member" href="#dom-sensoroptions-frequency" id="ref-for-dom-sensoroptions-frequency①">frequency</a></code> is <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-present" id="ref-for-dfn-present">present</a>, then</p>
      <ol>
       <li data-md>
        <p>Set <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-frequency-slot" id="ref-for-dom-sensor-frequency-slot②">[[frequency]]</a></code> to <var>options</var>.<code class="idl"><a class="idl-code" data-link-type="dict-member" href="#dom-sensoroptions-frequency" id="ref-for-dom-sensoroptions-frequency②">frequency</a></code>.</p>
      </ol>
      <p class="note" role="note"><span>Note:</span> there is not guarantee that the requested <var>options</var>.<code class="idl"><a class="idl-code" data-link-type="dict-member" href="#dom-sensoroptions-frequency" id="ref-for-dom-sensoroptions-frequency③">frequency</a></code> can be respected. The actual <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency⑨">sampling frequency</a> can be calculated using <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor②⓪">Sensor</a></code> <code class="idl"><a class="idl-code" data-link-type="attribute" href="#dom-sensor-timestamp" id="ref-for-dom-sensor-timestamp①">timestamp</a></code> attributes.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-dfn-type="dfn" data-export data-level="8.2" data-lt="Check sensor policy-controlled features" id="check-sensor-policy-controlled-features"><span class="secno">8.2. </span><span class="content">Check sensor policy-controlled features</span><a class="self-link" href="#check-sensor-policy-controlled-features"></a></h3>
   <div class="algorithm" data-algorithm="check sensor policy-controlled features">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor_type</var>, a <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type③①">sensor type</a>.</p>
     <dt data-md>output
     <dd data-md>
      <p>True if all of the associated <a data-link-type="dfn" href="#sensor-feature-names" id="ref-for-sensor-feature-names">sensor feature names</a> are <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#should-request-be-allowed-to-use-feature" id="ref-for-should-request-be-allowed-to-use-feature②">allowed to use</a>,
 false otherwise.</p>
    </dl>
    <ol>
     <li data-md>
      <p>Let <var>feature_names</var> be the <var>sensor_type</var>’s associated <a data-link-type="dfn" href="#sensor-feature-names" id="ref-for-sensor-feature-names①">sensor feature names</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate①">For each</a> <var>feature_name</var> of <var>feature_names</var>,</p>
      <ol>
       <li data-md>
        <p>If <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document⑥">active document</a> is not <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#should-request-be-allowed-to-use-feature" id="ref-for-should-request-be-allowed-to-use-feature③">allowed to use</a> the <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature③">policy-controlled feature</a> named <var>feature_name</var>, then:</p>
        <ol>
         <li data-md>
          <p>Return false.</p>
        </ol>
      </ol>
     <li data-md>
      <p>Return true.</p>
    </ol>
   </div>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-export data-level="8.3" data-lt="Connect to sensor" id="connect-to-sensor"><span class="secno">8.3. </span><span class="content">Connect to sensor</span></h3>
   <div class="algorithm" data-algorithm="connect to sensor">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor_instance</var>, a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor②①">Sensor</a></code> object.</p>
     <dt data-md>output
     <dd data-md>
      <p>True if sensor instance was associated with a <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor②②">platform sensor</a>,
 false otherwise.</p>
    </dl>
    <ol>
     <li data-md>
      <p>Let <var>type</var> be the <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type③②">sensor type</a> of <var>sensor_instance</var>.</p>
     <li data-md>
      <p>If the device has a single <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor②⑨">device sensor</a> which can provide <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading④③">readings</a> for <var>type</var>, then</p>
      <ol>
       <li data-md>
        <p>Associate <var>sensor_instance</var> with a <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor②③">platform sensor</a> corresponding
  to this <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor③⓪">device sensor</a>.</p>
       <li data-md>
        <p>Return true.</p>
      </ol>
     <li data-md>
      <p>If the device has multiple <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor③①">device sensors</a> which can provide <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading④④">readings</a> for <var>type</var>, then</p>
      <ol>
       <li data-md>
        <p>If <var>type</var> has an associated <a data-link-type="dfn" href="#default-sensor" id="ref-for-default-sensor④">default sensor</a>, then</p>
        <ol>
         <li data-md>
          <p>Associate <var>sensor_instance</var> with a <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor②④">platform sensor</a> corresponding
  to <a data-link-type="dfn" href="#default-sensor" id="ref-for-default-sensor⑤">default sensor</a>.</p>
         <li data-md>
          <p>Return true.</p>
        </ol>
      </ol>
     <li data-md>
      <p>Return false.</p>
    </ol>
   </div>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="8.4" data-lt="Activate a sensor object" data-noexport id="activate-a-sensor-object"><span class="secno">8.4. </span><span class="content">Activate a sensor object</span></h3>
   <div class="algorithm" data-algorithm="activate a sensor object">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor_instance</var>, a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor②②">Sensor</a></code> object.</p>
     <dt data-md>output
     <dd data-md>
      <p>None</p>
    </dl>
    <ol>
     <li data-md>
      <p>Let <var>sensor</var> be the <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor②⑤">platform sensor</a> associated with <var>sensor_instance</var>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#set-append" id="ref-for-set-append">Append</a> <var>sensor_instance</var> to <var>sensor</var>’s set of <a data-link-type="dfn" href="#activated-sensor-objects" id="ref-for-activated-sensor-objects⑤">activated sensor objects</a>.</p>
     <li data-md>
      <p>Invoke <a data-link-type="dfn" href="#set-sensor-settings" id="ref-for-set-sensor-settings">set sensor settings</a> with <var>sensor</var> as argument.</p>
     <li data-md>
      <p>Queue a task to run <a data-link-type="dfn" href="#notify-activated-state" id="ref-for-notify-activated-state">notify activated state</a> with <var>sensor_instance</var> as an argument.</p>
    </ol>
   </div>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="8.5" data-lt="Deactivate a sensor object" data-noexport id="deactivate-a-sensor-object"><span class="secno">8.5. </span><span class="content">Deactivate a sensor object</span></h3>
   <div class="algorithm" data-algorithm="deactivate a sensor object">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor_instance</var>, a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor②③">Sensor</a></code> object.</p>
     <dt data-md>output
     <dd data-md>
      <p>None</p>
    </dl>
    <ol>
     <li data-md>
      <p>Remove all <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task①">tasks</a> associated with <var>sensor_instance</var> from the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-queue" id="ref-for-task-queue">task queue</a> associated
  with <a data-link-type="dfn" href="#sensor-task-source" id="ref-for-sensor-task-source">sensor task source</a>.</p>
     <li data-md>
      <p>Let <var>sensor</var> be the <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor②⑥">platform sensor</a> associated with <var>sensor_instance</var>.</p>
     <li data-md>
      <p>If <var>sensor</var>’s set of <a data-link-type="dfn" href="#activated-sensor-objects" id="ref-for-activated-sensor-objects⑥">activated sensor objects</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-contain" id="ref-for-list-contain②">contains</a> <var>sensor_instance</var>,</p>
      <ol>
       <li data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-remove" id="ref-for-list-remove">Remove</a> <var>sensor_instance</var> from <var>sensor</var>’s set of <a data-link-type="dfn" href="#activated-sensor-objects" id="ref-for-activated-sensor-objects⑦">activated sensor objects</a>.</p>
       <li data-md>
        <p>Invoke <a data-link-type="dfn" href="#set-sensor-settings" id="ref-for-set-sensor-settings①">set sensor settings</a> with <var>sensor</var> as argument.</p>
       <li data-md>
        <p>Set <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-pendingreadingnotification-slot" id="ref-for-dom-sensor-pendingreadingnotification-slot">[[pendingReadingNotification]]</a></code> to false.</p>
       <li data-md>
        <p>Set <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-lasteventfiredat-slot" id="ref-for-dom-sensor-lasteventfiredat-slot">[[lastEventFiredAt]]</a></code> to null.</p>
      </ol>
    </ol>
   </div>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="8.6" data-lt="Revoke sensor permission" data-noexport id="revoke-sensor-permission"><span class="secno">8.6. </span><span class="content">Revoke sensor permission</span></h3>
   <div class="algorithm" data-algorithm="revoke sensor permission">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor</var>, a <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor②⑦">platform sensor</a>.</p>
     <dt data-md>output
     <dd data-md>
      <p>None</p>
    </dl>
    <ol>
     <li data-md>
      <p>Let <var>activated_sensors</var> be <var>sensor</var>’s associated <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set⑧">set</a> of <a data-link-type="dfn" href="#activated-sensor-objects" id="ref-for-activated-sensor-objects⑧">activated sensor objects</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate②">For each</a> <var>s</var> of <var>activated_sensors</var>,</p>
      <ol>
       <li data-md>
        <p>Invoke <a data-link-type="dfn" href="#deactivate-a-sensor-object" id="ref-for-deactivate-a-sensor-object②">deactivate a sensor object</a> with <var>s</var> as argument.</p>
       <li data-md>
        <p>Let <var>e</var> be the result of <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-create-exception" id="ref-for-dfn-create-exception②">creating</a> a "<code class="idl"><a class="idl-code" data-link-type="exception" href="https://heycam.github.io/webidl/#notallowederror" id="ref-for-notallowederror①">NotAllowedError</a></code>" <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException⑥">DOMException</a></code>.</p>
       <li data-md>
        <p>Queue a task to run <a data-link-type="dfn" href="#notify-error" id="ref-for-notify-error②">notify error</a> with <var>e</var> and <var>s</var> as arguments.</p>
      </ol>
    </ol>
   </div>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="8.7" data-lt="Set sensor settings" data-noexport id="set-sensor-settings"><span class="secno">8.7. </span><span class="content">Set sensor settings</span></h3>
   <div class="algorithm" data-algorithm="set sensor settings">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor</var>, a <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor②⑧">platform sensor</a>.</p>
     <dt data-md>output
     <dd data-md>
      <p>None</p>
    </dl>
    <ol>
     <li data-md>
      <p>If <var>sensor</var>’s set of <a data-link-type="dfn" href="#activated-sensor-objects" id="ref-for-activated-sensor-objects⑨">activated sensor objects</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-is-empty" id="ref-for-list-is-empty④">is empty</a>,</p>
      <ol>
       <li data-md>
        <p>Set <a data-link-type="dfn" href="#requested-sampling-frequency" id="ref-for-requested-sampling-frequency⑦">requested sampling frequency</a> to null.</p>
       <li data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-iterate" id="ref-for-map-iterate①">For each</a> <var>key</var> → <var>value</var> of <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading⑦">latest reading</a>.</p>
        <ol>
         <li data-md>
          <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-set" id="ref-for-map-set">Set</a> <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading⑧">latest reading</a>[<var>key</var>] to null.</p>
        </ol>
       <li data-md>
        <p>Update the user-agent-specific way in which <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading④⑤">sensor readings</a> are obtained from <var>sensor</var> to no longer provide <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading④⑥">readings</a>.</p>
       <li data-md>
        <p>Return.</p>
      </ol>
     <li data-md>
      <p>Set <a data-link-type="dfn" href="#requested-sampling-frequency" id="ref-for-requested-sampling-frequency⑧">requested sampling frequency</a> to <a data-link-type="dfn" href="#optimal-sampling-frequency" id="ref-for-optimal-sampling-frequency①">optimal sampling frequency</a>.</p>
    </ol>
   </div>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="8.8" data-lt="Update latest reading" data-noexport id="update-latest-reading"><span class="secno">8.8. </span><span class="content">Update latest reading</span></h3>
   <div class="algorithm" data-algorithm="update latest reading">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor</var>, a <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor②⑨">platform sensor</a>.</p>
     <dd data-md>
      <p><var>reading</var>, a <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading④⑦">sensor reading</a>.</p>
     <dt data-md>output
     <dd data-md>
      <p>None</p>
    </dl>
    <ol>
     <li data-md>
      <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-iterate" id="ref-for-map-iterate②">For each</a> <var>key</var> → <var>value</var> of <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading⑨">latest reading</a>.</p>
      <ol>
       <li data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-set" id="ref-for-map-set①">Set</a> <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading①⓪">latest reading</a>[<var>key</var>] to the corresponding
  value of <var>reading</var>.</p>
      </ol>
     <li data-md>
      <p>Let <var>activated_sensors</var> be <var>sensor</var>’s associated <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set⑨">set</a> of <a data-link-type="dfn" href="#activated-sensor-objects" id="ref-for-activated-sensor-objects①⓪">activated sensor objects</a>.</p>
     <li data-md>
      <p>Run these sub-steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate③">For each</a> <var>s</var> in <var>activated_sensors</var>,</p>
        <ol>
         <li data-md>
          <p>Invoke <a data-link-type="dfn" href="#report-latest-reading-updated" id="ref-for-report-latest-reading-updated">report latest reading updated</a> with <var>s</var> as an argument.</p>
        </ol>
      </ol>
    </ol>
   </div>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="8.9" data-lt="Find the reporting frequency of a sensor object" data-noexport id="find-the-reporting-frequency-of-a-sensor-object"><span class="secno">8.9. </span><span class="content">Find the reporting frequency of a sensor object</span></h3>
   <div class="algorithm" data-algorithm="find the reporting frequency of a sensor object">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor_instance</var>, a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor②④">Sensor</a></code> object.</p>
     <dt data-md>output
     <dd data-md>
      <p><a data-link-type="dfn" href="#reporting-frequency" id="ref-for-reporting-frequency②">reporting frequency</a> in Hz.</p>
    </dl>
    <ol>
     <li data-md>
      <p>Let <var>frequency</var> be null.</p>
     <li data-md>
      <p>Let <var>f</var> be <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-frequency-slot" id="ref-for-dom-sensor-frequency-slot③">[[frequency]]</a></code>.</p>
      <ol>
       <li data-md>
        <p>if <var>f</var> is set,</p>
        <ol>
         <li data-md>
          <p>set <var>frequency</var> to <var>f</var> capped by the upper and lower <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency①⓪">sampling frequency</a> bounds for the associated <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor③⓪">platform sensor</a>.</p>
        </ol>
       <li data-md>
        <p>Otherwise,</p>
        <ol>
         <li data-md>
          <p>user agent can assign <var>frequency</var> to an appropriate value.</p>
        </ol>
      </ol>
     <li data-md>
      <p>return <var>frequency</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="8.10" data-lt="Report latest reading updated" data-noexport id="report-latest-reading-updated"><span class="secno">8.10. </span><span class="content">Report latest reading updated</span></h3>
   <div class="algorithm" data-algorithm="report latest reading updated">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor_instance</var>, a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor②⑤">Sensor</a></code> object.</p>
     <dt data-md>output
     <dd data-md>
      <p>None</p>
    </dl>
    <ol>
     <li data-md>
      <p>If <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-pendingreadingnotification-slot" id="ref-for-dom-sensor-pendingreadingnotification-slot①">[[pendingReadingNotification]]</a></code> is true,</p>
      <ol>
       <li data-md>
        <p>Return.</p>
      </ol>
     <li data-md>
      <p>Set <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-pendingreadingnotification-slot" id="ref-for-dom-sensor-pendingreadingnotification-slot②">[[pendingReadingNotification]]</a></code> to true.</p>
     <li data-md>
      <p>Let <var>lastReportedTimestamp</var> be the value of <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-lasteventfiredat-slot" id="ref-for-dom-sensor-lasteventfiredat-slot①">[[lastEventFiredAt]]</a></code>.</p>
     <li data-md>
      <p>If <var>lastReportedTimestamp</var> is not set</p>
      <ol>
       <li data-md>
        <p>Queue a task to run <a data-link-type="dfn" href="#notify-new-reading" id="ref-for-notify-new-reading">notify new reading</a> with <var>sensor_instance</var> as an argument.</p>
       <li data-md>
        <p>Return.</p>
      </ol>
     <li data-md>
      <p>Let <var>reportingFrequency</var> be result of invoking <a data-link-type="dfn" href="#find-the-reporting-frequency-of-a-sensor-object" id="ref-for-find-the-reporting-frequency-of-a-sensor-object">Find the reporting frequency of a sensor object</a>.</p>
     <li data-md>
      <p>If <var>reportingFrequency</var> is null</p>
      <ol>
       <li data-md>
        <p>Queue a task to run <a data-link-type="dfn" href="#notify-new-reading" id="ref-for-notify-new-reading①">notify new reading</a> with <var>sensor_instance</var> as an argument.</p>
       <li data-md>
        <p>Return.</p>
      </ol>
     <li data-md>
      <p>Let <var>reportingInterval</var> be the result of 1 / <var>reportingFrequency</var>.</p>
     <li data-md>
      <p>Let <var>timestampDelta</var> be the result of <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading①①">latest reading</a>["timestamp"] - <var>lastReportedTimestamp</var>.</p>
     <li data-md>
      <p>If <var>timestampDelta</var> is greater than or equal to <var>reportingInterval</var></p>
      <ol>
       <li data-md>
        <p>Queue a task to run <a data-link-type="dfn" href="#notify-new-reading" id="ref-for-notify-new-reading②">notify new reading</a> with <var>sensor_instance</var> as an argument.</p>
       <li data-md>
        <p>Return.</p>
      </ol>
     <li data-md>
      <p>Let <var>deferUpdateTime</var> be the result of <var>reportingInterval</var> - <var>timestampDelta</var>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#spin-the-event-loop" id="ref-for-spin-the-event-loop">Spin the event loop</a> for a period of time equal to <var>deferUpdateTime</var>.</p>
     <li data-md>
      <p>If <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-pendingreadingnotification-slot" id="ref-for-dom-sensor-pendingreadingnotification-slot③">[[pendingReadingNotification]]</a></code> is true,</p>
      <ol>
       <li data-md>
        <p>Queue a task to run <a data-link-type="dfn" href="#notify-new-reading" id="ref-for-notify-new-reading③">notify new reading</a> with <var>sensor_instance</var> as an argument.</p>
      </ol>
    </ol>
   </div>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="8.11" data-lt="Notify new reading" data-noexport id="notify-new-reading"><span class="secno">8.11. </span><span class="content">Notify new reading</span></h3>
   <div class="algorithm" data-algorithm="notify new reading">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor_instance</var>, a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor②⑥">Sensor</a></code> object.</p>
     <dt data-md>output
     <dd data-md>
      <p>None</p>
    </dl>
    <ol>
     <li data-md>
      <p>Set <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-pendingreadingnotification-slot" id="ref-for-dom-sensor-pendingreadingnotification-slot④">[[pendingReadingNotification]]</a></code> to false.</p>
     <li data-md>
      <p>Set <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-lasteventfiredat-slot" id="ref-for-dom-sensor-lasteventfiredat-slot②">[[lastEventFiredAt]]</a></code> to <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading①②">latest reading</a>["timestamp"].</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire①">Fire an event</a> named "reading" at <var>sensor_instance</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="8.12" data-lt="Notify activated state" data-noexport id="notify-activated-state"><span class="secno">8.12. </span><span class="content">Notify activated state</span></h3>
   <div class="algorithm" data-algorithm="notify activated state">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor_instance</var>, a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor②⑦">Sensor</a></code> object.</p>
     <dt data-md>output
     <dd data-md>
      <p>None</p>
    </dl>
    <ol>
     <li data-md>
      <p>Set <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-state-slot" id="ref-for-dom-sensor-state-slot⑨">[[state]]</a></code> to "activated".</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire②">Fire an event</a> named "activate" at <var>sensor_instance</var>.</p>
     <li data-md>
      <p>Let <var>sensor</var> be the <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor③①">platform sensor</a> associated with <var>sensor_instance</var>.</p>
     <li data-md>
      <p>If <var>sensor</var>’s <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading①③">latest reading</a>["timestamp"] is not null,</p>
      <ol>
       <li data-md>
        <p>Queue a task to run <a data-link-type="dfn" href="#notify-new-reading" id="ref-for-notify-new-reading④">notify new reading</a> with <var>sensor_instance</var> as an argument.</p>
      </ol>
    </ol>
   </div>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="8.13" data-lt="Notify error" data-noexport id="notify-error"><span class="secno">8.13. </span><span class="content">Notify error</span></h3>
   <div class="algorithm" data-algorithm="notify error">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor_instance</var>, a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor②⑧">Sensor</a></code> object.</p>
     <dd data-md>
      <p><var>error</var>, a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException⑦">DOMException</a></code>.</p>
     <dt data-md>output
     <dd data-md>
      <p>None</p>
    </dl>
    <ol>
     <li data-md>
      <p>Set <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-state-slot" id="ref-for-dom-sensor-state-slot①⓪">[[state]]</a></code> to "idle".</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire③">Fire an event</a> named "error" at <var>sensor_instance</var> using <code class="idl"><a data-link-type="idl" href="#sensorerrorevent" id="ref-for-sensorerrorevent">SensorErrorEvent</a></code> with its <code class="idl"><a class="idl-code" data-link-type="attribute" href="#dom-sensorerrorevent-error" id="ref-for-dom-sensorerrorevent-error">error</a></code> attribute initialized to <var>error</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="8.14" data-lt="Get value from latest reading" data-noexport id="get-value-from-latest-reading"><span class="secno">8.14. </span><span class="content">Get value from latest reading</span></h3>
   <div class="algorithm" data-algorithm="get value from latest reading">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor_instance</var>, a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor②⑨">Sensor</a></code> object.</p>
     <dd data-md>
      <p><var>key</var>, a string representing the name of the value.</p>
     <dt data-md>output
     <dd data-md>
      <p>A <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading④⑧">sensor reading</a> value or null.</p>
    </dl>
    <ol>
     <li data-md>
      <p>If <var>sensor_instance</var>.<code class="idl"><a data-link-type="idl" href="#dom-sensor-state-slot" id="ref-for-dom-sensor-state-slot①①">[[state]]</a></code> is "activated",</p>
      <ol>
       <li data-md>
        <p>Let <var>readings</var> be the <a data-link-type="dfn" href="#latest-reading" id="ref-for-latest-reading①④">latest reading</a> of <var>sensor_instance</var>’s related <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor③②">platform sensor</a>.</p>
       <li data-md>
        <p>If the <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification②">extension specification</a> defines a <a data-link-type="dfn" href="#local-coordinate-system" id="ref-for-local-coordinate-system②">local coordinate system</a> for <var>sensor_instance</var>,</p>
        <ol>
         <li data-md>
          <p>Remap (see <a data-link-type="biblio" href="#biblio-coordinates-transformation">[COORDINATES-TRANSFORMATION]</a>) <var>readings</var> values to the <a data-link-type="dfn" href="#local-coordinate-system" id="ref-for-local-coordinate-system③">local coordinate system</a>.</p>
        </ol>
       <li data-md>
        <p>Return <var>readings</var>[<var>key</var>].</p>
      </ol>
     <li data-md>
      <p>Otherwise, return null.</p>
    </ol>
   </div>
   <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-level="8.15" data-lt="Request sensor access" data-noexport id="request-sensor-access"><span class="secno">8.15. </span><span class="content">Request sensor access</span></h3>
   <div class="algorithm" data-algorithm="request sensor access">
    <dl>
     <dt data-md>input
     <dd data-md>
      <p><var>sensor_instance</var>, a <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor③⓪">Sensor</a></code> object.</p>
     <dt data-md>output
     <dd data-md>
      <p>A <a data-link-type="dfn" href="https://www.w3.org/TR/permissions/#permission-state" id="ref-for-permission-state①">permission state</a>.</p>
    </dl>
    <ol>
     <li data-md>
      <p>Let <var>sensor</var> be the <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor③③">platform sensor</a> associated with <var>sensor_instance</var>.</p>
     <li data-md>
      <p>Let <var>sensor_permissions</var> be <var>sensor</var>’s associated <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set①⓪">set</a> of <a data-link-type="dfn" href="#sensor-permission-names" id="ref-for-sensor-permission-names②">permission names</a>.</p>
     <li data-md>
      <p>Run these sub-steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel③">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate④">For each</a> <var>permission_name</var> in <var>sensor_permissions</var>,</p>
        <ol>
         <li data-md>
          <p>Let <var>state</var> be the result of <a data-link-type="dfn" href="https://w3c.github.io/permissions/#request-permission-to-use" id="ref-for-request-permission-to-use">requesting permission to use</a> <var>permission_name</var>.</p>
         <li data-md>
          <p>If <var>state</var> is "denied"</p>
          <ol>
           <li data-md>
            <p>Return "denied".</p>
          </ol>
        </ol>
       <li data-md>
        <p>Otherwise, return "granted".</p>
      </ol>
    </ol>
   </div>
   <h2 class="heading settled" data-level="9" id="automation"><span class="secno">9. </span><span class="content">Automation</span><a class="self-link" href="#automation"></a></h2>
   <p>The Generic Sensor API and its <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification③">extension specifications</a> pose a challenge
to test authors, as fully exercising those interfaces requires physical hardware
devices that respond in predictable ways. To address this challenge this document
defines a number of <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-extension-command" id="ref-for-dfn-extension-command">extension commands</a> to the <a data-link-type="biblio" href="#biblio-webdriver">[WebDriver]</a> specification
for controlling <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor">mock sensor</a> on the host that the user agent is running on.
With these <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-extension-command" id="ref-for-dfn-extension-command①">extension commands</a>, devices with particular properties can be created
and their responses to requests are well defined.</p>
   <h3 class="heading settled" data-level="9.1" id="mock-sensors"><span class="secno">9.1. </span><span class="content">Mock Sensors</span><a class="self-link" href="#mock-sensors"></a></h3>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="mock-sensor">mock sensor</dfn> simulates the behavior of a <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor③④">platform sensor</a> in controlled ways.</p>
   <p>A <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor①">mock sensor</a> reports a corresponding <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="mock-sensor-reading">mock <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading④⑨">sensor reading</a></dfn>, which is a source of
mocking information about the environment, to the <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor③①">Sensor</a></code> objects.</p>
   <p>The <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context">current browsing context</a>'s <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor②">mock sensor</a> has an associated <a data-link-type="dfn" href="#mock-sensor-reading" id="ref-for-mock-sensor-reading">mock sensor reading</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map⑥">map</a>.</p>
   <p>The <a data-link-type="dfn" href="#mock-sensor-reading" id="ref-for-mock-sensor-reading①">mock sensor reading</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map⑦">map</a> contains an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-entry" id="ref-for-map-entry④">entry</a> whose <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-key" id="ref-for-map-key②">key</a> is
"timestamp" and whose <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-value" id="ref-for-map-value②">value</a> is a high resolution timestamp that estimates the time <a data-link-type="dfn" href="#mock-sensor-reading" id="ref-for-mock-sensor-reading②">mock sensor reading</a> sent to observers of the <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor③②">Sensor</a></code> object, expressed in milliseconds since the <a data-link-type="dfn" href="https://www.w3.org/TR/hr-time-2/#dfn-time-origin" id="ref-for-dfn-time-origin②">time origin</a>.</p>
   <p>The other <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-entry" id="ref-for-map-entry⑤">entries</a> of the <a data-link-type="dfn" href="#mock-sensor-reading" id="ref-for-mock-sensor-reading③">mock sensor reading</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map⑧">map</a> whose <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-key" id="ref-for-map-key③">keys</a> must match the <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary-member" id="ref-for-dfn-dictionary-member">dictionary members</a> <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-identifier" id="ref-for-dfn-identifier②">identifier</a> defined by the <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type">mock sensor type</a>'s <code class="idl"><a data-link-type="idl" href="#dictdef-mocksensorreadingvalues" id="ref-for-dictdef-mocksensorreadingvalues">MockSensorReadingValues</a></code> and whose initial <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-value" id="ref-for-map-value③">values</a> are implementation-dependent.</p>
   <p class="note" role="note"><span>Note:</span> The user agent must provide the <a data-link-type="dfn" href="#mock-sensor-reading" id="ref-for-mock-sensor-reading④">mock sensor reading</a> that are initially exposed to the <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor③③">Sensor</a></code> objects.</p>
   <p>A <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor③">mock sensor</a> has an associated <a data-link-type="dfn" href="#requested-sampling-frequency" id="ref-for-requested-sampling-frequency⑨">requested sampling frequency</a>. Its default value is implementation-dependent
but must be set within a <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor④">mock sensor</a>'s associated <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency①①">sampling frequency</a> bounds.</p>
   <p>A <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor⑤">mock sensor</a> has an associated <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency①②">sampling frequency</a> with supported bounds. The default values of
supported bounds are implementation-dependent.</p>
   <p>A <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor⑥">mock sensor</a> must report the <a data-link-type="dfn" href="#mock-sensor-reading" id="ref-for-mock-sensor-reading⑤">mock sensor reading</a> at the rate of its <a data-link-type="dfn" href="#requested-sampling-frequency" id="ref-for-requested-sampling-frequency①⓪">requested sampling frequency</a> if the user agent <a data-link-type="dfn" href="#can-expose-sensor-readings" id="ref-for-can-expose-sensor-readings②">can expose sensor readings</a> to the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context①">current browsing context</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document⑦">active document</a>.</p>
   <p class="note" role="note"><span>Note:</span> The <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor⑦">mock sensor</a> defined in this specification is not intended be used by non-testing-related web content.
The UA MAY choose to expose <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor⑧">mock sensor</a> interface only when a runtime or compile-time flag has been set.</p>
   <h4 class="heading settled" data-level="9.1.1" id="dictionary-mocksensorconfiguration"><span class="secno">9.1.1. </span><span class="content">MockSensorConfiguration dictionary</span><a class="self-link" href="#dictionary-mocksensorconfiguration"></a></h4>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-mocksensorconfiguration"><code><c- g>MockSensorConfiguration</c-></code></dfn> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#enumdef-mocksensortype" id="ref-for-enumdef-mocksensortype"><c- n>MockSensorType</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorConfiguration" data-dfn-type="dict-member" data-export data-type="MockSensorType " id="dom-mocksensorconfiguration-mocksensortype"><code><c- g>mockSensorType</c-></code></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="true" data-dfn-for="MockSensorConfiguration" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-mocksensorconfiguration-connected"><code><c- g>connected</c-></code></dfn> = <c- b>true</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-double" id="ref-for-idl-double①"><c- b>double</c-></a>? <dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorConfiguration" data-dfn-type="dict-member" data-export data-type="double? " id="dom-mocksensorconfiguration-maxsamplingfrequency"><code><c- g>maxSamplingFrequency</c-></code></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-double" id="ref-for-idl-double②"><c- b>double</c-></a>? <dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorConfiguration" data-dfn-type="dict-member" data-export data-type="double? " id="dom-mocksensorconfiguration-minsamplingfrequency"><code><c- g>minSamplingFrequency</c-></code></dfn>;
};
</pre>
   <p>The <code class="idl"><a data-link-type="idl" href="#dictdef-mocksensorconfiguration" id="ref-for-dictdef-mocksensorconfiguration">MockSensorConfiguration</a></code> dictionary is used to <a href="#create-mock-sensor-command">create a mock sensor</a>.</p>
   <dl>
    <dt data-md><code class="idl"><a data-link-type="idl" href="#dom-mocksensorconfiguration-mocksensortype" id="ref-for-dom-mocksensorconfiguration-mocksensortype">mockSensorType</a></code> member
    <dd data-md>
     <p>A <code class="idl"><a data-link-type="idl" href="#enumdef-mocksensortype" id="ref-for-enumdef-mocksensortype①">MockSensorType</a></code> that is used to set <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type①">mock sensor type</a>.</p>
    <dt data-md><code class="idl"><a data-link-type="idl" href="#dom-mocksensorconfiguration-connected" id="ref-for-dom-mocksensorconfiguration-connected">connected</a></code> member
    <dd data-md>
     <p>A boolean that indicates a <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor⑨">mock sensor</a>'s <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="connection-flag">connection flag</dfn> which is used for switching the connection
 between <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor③④">Sensor</a></code> object and <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor①⓪">mock sensor</a>. When set to false the user agent must force the result of invoking <a data-link-type="dfn" href="#connect-to-sensor" id="ref-for-connect-to-sensor①">connect to sensor</a> with <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor①①">mock sensor</a>'s associated <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor③⑤">Sensor</a></code> object as argument to false, otherwise true.</p>
    <dt data-md><code class="idl"><a data-link-type="idl" href="#dom-mocksensorconfiguration-maxsamplingfrequency" id="ref-for-dom-mocksensorconfiguration-maxsamplingfrequency">maxSamplingFrequency</a></code> member
    <dd data-md>
     <p>A double representing frequency in Hz that is used to set maximum supported <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency①③">sampling frequency</a> for the associated <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor①②">mock sensor</a>.</p>
    <dt data-md><code class="idl"><a data-link-type="idl" href="#dom-mocksensorconfiguration-minsamplingfrequency" id="ref-for-dom-mocksensorconfiguration-minsamplingfrequency">minSamplingFrequency</a></code> member
    <dd data-md>
     <p>A double representing frequency in Hz that is used to set minimum supported <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency①④">sampling frequency</a> for the associated <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor①③">mock sensor</a>.</p>
   </dl>
   <h4 class="heading settled" data-level="9.1.2" id="dictionary-mocksensor"><span class="secno">9.1.2. </span><span class="content">MockSensor dictionary</span><a class="self-link" href="#dictionary-mocksensor"></a></h4>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-mocksensor"><code><c- g>MockSensor</c-></code></dfn> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-double" id="ref-for-idl-double③"><c- b>double</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="MockSensor" data-dfn-type="dict-member" data-export data-type="double " id="dom-mocksensor-maxsamplingfrequency"><code><c- g>maxSamplingFrequency</c-></code></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-double" id="ref-for-idl-double④"><c- b>double</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="MockSensor" data-dfn-type="dict-member" data-export data-type="double " id="dom-mocksensor-minsamplingfrequency"><code><c- g>minSamplingFrequency</c-></code></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-double" id="ref-for-idl-double⑤"><c- b>double</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="MockSensor" data-dfn-type="dict-member" data-export data-type="double " id="dom-mocksensor-requestedsamplingfrequency"><code><c- g>requestedSamplingFrequency</c-></code></dfn>;
};
</pre>
   <p>The <code class="idl"><a data-link-type="idl" href="#dictdef-mocksensor" id="ref-for-dictdef-mocksensor">MockSensor</a></code> dictionary provides information about a <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor①④">mock sensor</a>.</p>
   <dl>
    <dt data-md><code class="idl"><a data-link-type="idl" href="#dom-mocksensor-maxsamplingfrequency" id="ref-for-dom-mocksensor-maxsamplingfrequency">maxSamplingFrequency</a></code> member
    <dd data-md>
     <p>A double representing frequency in Hz that indicates the maximum supported <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency①⑤">sampling frequency</a> of the associated <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor①⑤">mock sensor</a>.</p>
    <dt data-md><code class="idl"><a data-link-type="idl" href="#dom-mocksensor-minsamplingfrequency" id="ref-for-dom-mocksensor-minsamplingfrequency">minSamplingFrequency</a></code> member
    <dd data-md>
     <p>A double representing frequency in Hz that indicates the minimum supported <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency①⑥">sampling frequency</a> of the associated <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor①⑥">mock sensor</a>.</p>
    <dt data-md><code class="idl"><a data-link-type="idl" href="#dom-mocksensor-requestedsamplingfrequency" id="ref-for-dom-mocksensor-requestedsamplingfrequency">requestedSamplingFrequency</a></code> member
    <dd data-md>
     <p>A double representing frequency in Hz that indicates the <a data-link-type="dfn" href="#requested-sampling-frequency" id="ref-for-requested-sampling-frequency①①">requested sampling frequency</a> of the associated <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor①⑦">mock sensor</a>.</p>
   </dl>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="serialized-mock-sensor">serialized mock sensor</dfn> is a JSON <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-object" id="ref-for-dfn-object">Object</a> where a <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor①⑧">mock sensor</a>'s fields listed in the <code class="idl"><a data-link-type="idl" href="#dictdef-mocksensor" id="ref-for-dictdef-mocksensor①">MockSensor</a></code> dictionary are mapped
using the <i>JSON Key</i> and the associated field’s value from the available <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor①⑨">mock sensor</a> in <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context②">current browsing context</a>.</p>
   <h4 class="heading settled" data-level="9.1.3" id="section-mock-sensor-type"><span class="secno">9.1.3. </span><span class="content">Mock sensor type</span><a class="self-link" href="#section-mock-sensor-type"></a></h4>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="mock-sensor-type">mock sensor type</dfn> is equivalent to a <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type③③">sensor type</a>'s associated <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor③⑥">Sensor</a></code> subclass.</p>
<pre class="idl highlight def"><c- b>enum</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export id="enumdef-mocksensortype"><code><c- g>MockSensorType</c-></code></dfn> {
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-ambient-light" id="ref-for-dom-mocksensortype-ambient-light"><c- s>"ambient-light"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-accelerometer" id="ref-for-dom-mocksensortype-accelerometer"><c- s>"accelerometer"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-linear-acceleration" id="ref-for-dom-mocksensortype-linear-acceleration"><c- s>"linear-acceleration"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-gravity" id="ref-for-dom-mocksensortype-gravity"><c- s>"gravity"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-gyroscope" id="ref-for-dom-mocksensortype-gyroscope"><c- s>"gyroscope"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-magnetometer" id="ref-for-dom-mocksensortype-magnetometer"><c- s>"magnetometer"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-uncalibrated-magnetometer" id="ref-for-dom-mocksensortype-uncalibrated-magnetometer"><c- s>"uncalibrated-magnetometer"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-absolute-orientation" id="ref-for-dom-mocksensortype-absolute-orientation"><c- s>"absolute-orientation"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-relative-orientation" id="ref-for-dom-mocksensortype-relative-orientation"><c- s>"relative-orientation"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-geolocation" id="ref-for-dom-mocksensortype-geolocation"><c- s>"geolocation"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-proximity" id="ref-for-dom-mocksensortype-proximity"><c- s>"proximity"</c-></a>,
};
</pre>
   <p>Each enumeration value in the <code class="idl"><a data-link-type="idl" href="#enumdef-mocksensortype" id="ref-for-enumdef-mocksensortype②">MockSensorType</a></code> enum identifies a <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type②">mock sensor type</a>.</p>
   <dl>
    <dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorType" data-dfn-type="enum-value" data-export id="dom-mocksensortype-ambient-light"><code>"ambient-light"</code></dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type③">mock sensor type</a> associated with the usage of the <a data-link-type="dfn" href="https://w3c.github.io/ambient-light#ambient-light-sensor-interface" id="ref-for-ambient-light-sensor-interface">AmbientLightSensor</a> interface.</p>
    <dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorType" data-dfn-type="enum-value" data-export id="dom-mocksensortype-accelerometer"><code>"accelerometer"</code></dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type④">mock sensor type</a> associated with the usage of the <a data-link-type="dfn" href="https://w3c.github.io/accelerometer#accelerometer-interface" id="ref-for-accelerometer-interface">Accelerometer</a> interface.</p>
    <dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorType" data-dfn-type="enum-value" data-export id="dom-mocksensortype-linear-acceleration"><code>"linear-acceleration"</code></dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type⑤">mock sensor type</a> associated with the usage of the <a data-link-type="dfn" href="https://w3c.github.io/accelerometer#linearaccelerationsensor-interface" id="ref-for-linearaccelerationsensor-interface">LinearAccelerationSensor</a> interface.</p>
    <dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorType" data-dfn-type="enum-value" data-export id="dom-mocksensortype-gravity"><code>"gravity"</code></dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type⑥">mock sensor type</a> associated with the usage of the <a data-link-type="dfn" href="https://w3c.github.io/accelerometer#gravitysensor-interface" id="ref-for-gravitysensor-interface">GravitySensor</a> interface.</p>
    <dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorType" data-dfn-type="enum-value" data-export id="dom-mocksensortype-gyroscope"><code>"gyroscope"</code></dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type⑦">mock sensor type</a> associated with the usage of the <a data-link-type="dfn" href="https://w3c.github.io/gyroscope#gyroscope-interface" id="ref-for-gyroscope-interface">Gyroscope</a> interface.</p>
    <dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorType" data-dfn-type="enum-value" data-export id="dom-mocksensortype-magnetometer"><code>"magnetometer"</code></dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type⑧">mock sensor type</a> associated with the usage of the <a data-link-type="dfn" href="https://w3c.github.io/magnetometer#magnetometer-interface" id="ref-for-magnetometer-interface">Magnetometer</a> interface.</p>
    <dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorType" data-dfn-type="enum-value" data-export id="dom-mocksensortype-uncalibrated-magnetometer"><code>"uncalibrated-magnetometer"</code></dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type⑨">mock sensor type</a> associated with the usage of the <a data-link-type="dfn" href="https://w3c.github.io/magnetometer#uncalibrated-magnetometer-interface" id="ref-for-uncalibrated-magnetometer-interface">UncalibratedMagnetometer</a> interface.</p>
    <dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorType" data-dfn-type="enum-value" data-export id="dom-mocksensortype-absolute-orientation"><code>"absolute-orientation"</code></dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type①⓪">mock sensor type</a> associated with the usage of the <a data-link-type="dfn" href="https://w3c.github.io/orientation-sensor#absoluteorientationsensor-interface" id="ref-for-absoluteorientationsensor-interface">AbsoluteOrientationSensor</a> interface.</p>
    <dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorType" data-dfn-type="enum-value" data-export id="dom-mocksensortype-relative-orientation"><code>"relative-orientation"</code></dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type①①">mock sensor type</a> associated with the usage of the <a data-link-type="dfn" href="https://w3c.github.io/orientation-sensor#relativeorientationsensor-interface" id="ref-for-relativeorientationsensor-interface">RelativeOrientationSensor</a> interface.</p>
    <dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorType" data-dfn-type="enum-value" data-export id="dom-mocksensortype-geolocation"><code>"geolocation"</code></dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type①②">mock sensor type</a> associated with the usage of the <a data-link-type="dfn" href="https://w3c.github.io/geolocation-sensor/#geolocationsensor-interface" id="ref-for-geolocationsensor-interface">GeolocationSensor</a> interface.</p>
    <dt data-md><dfn class="dfn-paneled idl-code" data-dfn-for="MockSensorType" data-dfn-type="enum-value" data-export id="dom-mocksensortype-proximity"><code>"proximity"</code></dfn>
    <dd data-md>
     <p>A <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type①③">mock sensor type</a> associated with the usage of the <a data-link-type="dfn" href="https://w3c.github.io/proximity#proximity-sensor-interface" id="ref-for-proximity-sensor-interface">ProximitySensor</a> interface.</p>
   </dl>
   <p>Each <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type①④">mock sensor type</a> has a <a data-link-type="dfn" href="#mock-sensor-reading-values" id="ref-for-mock-sensor-reading-values">mock sensor reading values</a> dictionary:</p>
   <dl>
    <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="mock-sensor-reading-values">Mock Sensor Reading Values</dfn> dictionary
    <dd data-md>
     <p><code class="idl"><a data-link-type="idl" href="#dictdef-mocksensorreadingvalues" id="ref-for-dictdef-mocksensorreadingvalues①">MockSensorReadingValues</a></code> dictionary represents a user-specified <a data-link-type="dfn" href="#mock-sensor-reading" id="ref-for-mock-sensor-reading⑥">mock sensor reading</a> used for <a href="#update-mock-sensor-reading-command">updating a mock sensor reading</a>. Its members must match the <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-attribute" id="ref-for-dfn-attribute③">attribute</a> <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-identifier" id="ref-for-dfn-identifier③">identifier</a> defined by the <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type③④">sensor type</a>'s
 associated <a data-link-type="dfn" href="#extension-sensor-interface" id="ref-for-extension-sensor-interface③">extension sensor interface</a>. Each <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type①⑤">mock sensor type</a> has a specific <code class="idl"><a data-link-type="idl" href="#dictdef-mocksensorreadingvalues" id="ref-for-dictdef-mocksensorreadingvalues②">MockSensorReadingValues</a></code>, which is defined in each <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification④">extension specifications</a>.</p>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-mocksensorreadingvalues"><code><c- g>MockSensorReadingValues</c-></code></dfn> {
};
</pre>
   </dl>
   <h3 class="heading settled" data-level="9.2" id="section-extension-commands"><span class="secno">9.2. </span><span class="content">Extension Commands</span><a class="self-link" href="#section-extension-commands"></a></h3>
   <h4 class="heading settled" data-level="9.2.1" id="create-mock-sensor-command"><span class="secno">9.2.1. </span><span class="content">Create mock sensor</span><a class="self-link" href="#create-mock-sensor-command"></a></h4>
   <table>
    <tbody>
     <tr>
      <th>HTTP Method
      <th><a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-extension-command-uri-template" id="ref-for-dfn-extension-command-uri-template">URI Template</a>
     <tr>
      <td>POST
      <td>/session/{session id}/sensor
   </table>
   <div class="algorithm" data-algorithm="create mock sensor">
    <p>The <dfn data-dfn-type="dfn" data-noexport id="create-mock-sensor">create mock sensor<a class="self-link" href="#create-mock-sensor"></a></dfn> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-extension-command" id="ref-for-dfn-extension-command②">extension command</a> creates a
    new <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor②⓪">mock sensor</a>.</p>
    <p>The <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-remote-end-steps" id="ref-for-dfn-remote-end-steps">remote end steps</a> are:</p>
    <ol>
     <li data-md>
      <p>Let <var>configuration</var> be the <var>configuration</var> parameter, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value" id="ref-for-dfn-convert-ecmascript-to-idl-value">converted to an IDL value</a> of type <code class="idl"><a data-link-type="idl" href="#dictdef-mocksensorconfiguration" id="ref-for-dictdef-mocksensorconfiguration①">MockSensorConfiguration</a></code>. If this throws an exception, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code">WebDriver error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-invalid-argument" id="ref-for-dfn-invalid-argument">invalid argument</a>.</p>
     <li data-md>
      <p>Let <var>type</var> be the <var>configuration</var>.<code class="idl"><a data-link-type="idl" href="#dom-mocksensorconfiguration-mocksensortype" id="ref-for-dom-mocksensorconfiguration-mocksensortype①">mockSensorType</a></code>. If the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context③">current browsing context</a> already has this <var>type</var> of <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor②①">mock sensor</a>, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors①">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code①">WebDriver error code</a> <a data-link-type="dfn" href="#mock-sensor-already-created" id="ref-for-mock-sensor-already-created">mock sensor already created</a>.</p>
     <li data-md>
      <p>If the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context④">current browsing context</a> is <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-no-longer-open" id="ref-for-dfn-no-longer-open">no longer open</a>, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors②">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code②">WebDriver error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-no-such-window" id="ref-for-dfn-no-such-window">no such window</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-handle-any-user-prompts" id="ref-for-dfn-handle-any-user-prompts">Handle any user prompts</a>, and return its value if it is a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors③">WebDriver error</a>.</p>
     <li data-md>
      <p>Run these sub-steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel④">in parallel</a> to create a <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor②②">mock sensor</a> in the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context⑤">current browsing context</a>:</p>
      <ol>
       <li data-md>
        <p>Let <var>mock</var> be a new <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor②③">mock sensor</a>.</p>
       <li data-md>
        <p>Set <var>mock</var>’s <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type①⑥">mock sensor type</a> to <var>type</var>.</p>
       <li data-md>
        <p>Let <var>connected</var> be the <var>configuration</var>.<code class="idl"><a data-link-type="idl" href="#dom-mocksensorconfiguration-connected" id="ref-for-dom-mocksensorconfiguration-connected①">connected</a></code>, set <var>mock</var>’s associated <a data-link-type="dfn" href="#connection-flag" id="ref-for-connection-flag">connection flag</a> to <var>connected</var>.</p>
       <li data-md>
        <p>If <var>configuration</var>.<code class="idl"><a data-link-type="idl" href="#dom-mocksensorconfiguration-maxsamplingfrequency" id="ref-for-dom-mocksensorconfiguration-maxsamplingfrequency①">maxSamplingFrequency</a></code> is <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-present" id="ref-for-dfn-present①">present</a>, then:</p>
        <ol>
         <li data-md>
          <p>Set <var>mock</var>’s maximum supported sampling frequency to <var>configuration</var>.<code class="idl"><a data-link-type="idl" href="#dom-mocksensorconfiguration-maxsamplingfrequency" id="ref-for-dom-mocksensorconfiguration-maxsamplingfrequency②">maxSamplingFrequency</a></code>.</p>
        </ol>
       <li data-md>
        <p>If <var>configuration</var>.<code class="idl"><a data-link-type="idl" href="#dom-mocksensorconfiguration-minsamplingfrequency" id="ref-for-dom-mocksensorconfiguration-minsamplingfrequency①">minSamplingFrequency</a></code> is <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-present" id="ref-for-dfn-present②">present</a>, then:</p>
        <ol>
         <li data-md>
          <p>Set <var>mock</var>’s minimum supported sampling frequency to <var>configuration</var>.<code class="idl"><a data-link-type="idl" href="#dom-mocksensorconfiguration-minsamplingfrequency" id="ref-for-dom-mocksensorconfiguration-minsamplingfrequency②">minSamplingFrequency</a></code>.</p>
        </ol>
       <li data-md>
        <p>Let <var>sensor_instance</var> be a <var>type</var> of <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor③⑦">Sensor</a></code> object, set <var>sensor_instance</var>’s associated <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor③⑤">platform sensor</a> to <var>mock</var>.</p>
      </ol>
     <li data-md>
      <p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-success" id="ref-for-dfn-success">success</a> with data <code>null</code>.</p>
    </ol>
   </div>
   <div class="example" id="example-1f159a4e">
    <a class="self-link" href="#example-1f159a4e"></a> To create an "ambient-light" mock sensor in the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context⑥">current browsing context</a> of the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-session" id="ref-for-dfn-session">session</a> with ID 23,
  the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-local-end" id="ref-for-dfn-local-end">local end</a> would POST to <code>/session/23/sensor</code> with the body: 
<pre class="lang-json highlight"><c- p>{</c->
  <c- f>"mockSensorType"</c-><c- p>:</c-> <c- u>"ambient-light"</c-><c- p>,</c->
  <c- f>"maxSamplingFrequency"</c-><c- p>:</c-> <c- mi>60</c-><c- p>,</c->
  <c- f>"minSamplingFrequency"</c-><c- p>:</c-> <c- mi>5</c->
<c- p>}</c->
</pre>
    <p>Be aware that only one <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor②④">mock sensor</a> of a given <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type①⑦">mock sensor type</a> can be created in <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context⑦">current browsing context</a>,
  otherwise a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors④">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code③">WebDriver error code</a> <a data-link-type="dfn" href="#mock-sensor-already-created" id="ref-for-mock-sensor-already-created①">mock sensor already created</a> will be thrown.</p>
   </div>
   <h4 class="heading settled" data-level="9.2.2" id="get-mock-sensor-command"><span class="secno">9.2.2. </span><span class="content">Get mock sensor</span><a class="self-link" href="#get-mock-sensor-command"></a></h4>
   <table>
    <tbody>
     <tr>
      <th>HTTP Method
      <th><a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-extension-command-uri-template" id="ref-for-dfn-extension-command-uri-template①">URI Template</a>
     <tr>
      <td>GET
      <td>/session/{session id}/sensor/{type}
   </table>
   <div class="algorithm" data-algorithm="get mock sensor">
    <p>The <dfn data-dfn-type="dfn" data-noexport id="get-mock-sensor">get mock sensor<a class="self-link" href="#get-mock-sensor"></a></dfn> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-extension-command" id="ref-for-dfn-extension-command③">extension command</a> retrieves
    information about a given type of <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor②⑤">mock sensor</a>.</p>
    <p>The <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-remote-end-steps" id="ref-for-dfn-remote-end-steps①">remote end steps</a> are:</p>
    <ol>
     <li data-md>
      <p>Let <var>type</var> be a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-url-variables" id="ref-for-dfn-url-variables">url variable</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value" id="ref-for-dfn-convert-ecmascript-to-idl-value①">converted to an IDL value</a> of type <code class="idl"><a data-link-type="idl" href="#enumdef-mocksensortype" id="ref-for-enumdef-mocksensortype③">MockSensorType</a></code>.
  If this throws an exception, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors⑤">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code④">WebDriver error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-invalid-argument" id="ref-for-dfn-invalid-argument①">invalid argument</a>.</p>
     <li data-md>
      <p>If the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context⑧">current browsing context</a> is <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-no-longer-open" id="ref-for-dfn-no-longer-open①">no longer open</a>, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors⑥">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑤">WebDriver error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-no-such-window" id="ref-for-dfn-no-such-window①">no such window</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-handle-any-user-prompts" id="ref-for-dfn-handle-any-user-prompts①">Handle any user prompts</a>, and return its value if it is a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors⑦">WebDriver error</a>.</p>
     <li data-md>
      <p>If <var>type</var> does not match a <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type①⑧">mock sensor type</a> amongst all associated <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor②⑥">mock sensors</a> of the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context⑨">current browsing context</a>, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors⑧">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑥">WebDriver error code</a> <a data-link-type="dfn" href="#no-such-mock-sensor" id="ref-for-no-such-mock-sensor">no such mock sensor</a>.</p>
     <li data-md>
      <p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-success" id="ref-for-dfn-success①">success</a> with the <a data-link-type="dfn" href="#serialized-mock-sensor" id="ref-for-serialized-mock-sensor">serialized mock sensor</a> as data.</p>
    </ol>
   </div>
   <h4 class="heading settled" data-level="9.2.3" id="update-mock-sensor-reading-command"><span class="secno">9.2.3. </span><span class="content">Update mock sensor reading</span><a class="self-link" href="#update-mock-sensor-reading-command"></a></h4>
   <table>
    <tbody>
     <tr>
      <th>HTTP Method
      <th><a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-extension-command-uri-template" id="ref-for-dfn-extension-command-uri-template②">URI Template</a>
     <tr>
      <td>POST
      <td>/session/{session id}/sensor/{type}
   </table>
   <div class="algorithm" data-algorithm="update mock sensor reading">
    <p>The <dfn data-dfn-type="dfn" data-noexport id="update-mock-sensor-reading">update mock sensor reading<a class="self-link" href="#update-mock-sensor-reading"></a></dfn> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-extension-command" id="ref-for-dfn-extension-command④">extension command</a> updates
    a given type of <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor②⑦">mock sensor</a>'s <a data-link-type="dfn" href="#mock-sensor-reading" id="ref-for-mock-sensor-reading⑦">reading</a>.</p>
    <p>The <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-remote-end-steps" id="ref-for-dfn-remote-end-steps②">remote end steps</a> are:</p>
    <ol>
     <li data-md>
      <p>Let <var>type</var> be a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-url-variables" id="ref-for-dfn-url-variables①">url variable</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value" id="ref-for-dfn-convert-ecmascript-to-idl-value②">converted to an IDL value</a> of type <code class="idl"><a data-link-type="idl" href="#enumdef-mocksensortype" id="ref-for-enumdef-mocksensortype④">MockSensorType</a></code>.
  If this throws an exception, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors⑨">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑦">WebDriver error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-invalid-argument" id="ref-for-dfn-invalid-argument②">invalid argument</a>.</p>
     <li data-md>
      <p>If the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context①⓪">current browsing context</a> is <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-no-longer-open" id="ref-for-dfn-no-longer-open②">no longer open</a>, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors①⓪">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑧">WebDriver error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-no-such-window" id="ref-for-dfn-no-such-window②">no such window</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-handle-any-user-prompts" id="ref-for-dfn-handle-any-user-prompts②">Handle any user prompts</a>, and return its value if it is a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors①①">WebDriver error</a>.</p>
     <li data-md>
      <p>If <var>type</var> does not match a <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type①⑨">mock sensor type</a> amongst all associated <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor②⑧">mock sensors</a> of the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context①①">current browsing context</a>, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors①②">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code⑨">WebDriver error code</a> <a data-link-type="dfn" href="#no-such-mock-sensor" id="ref-for-no-such-mock-sensor①">no such mock sensor</a>.</p>
     <li data-md>
      <p>Let <var>reading</var> be the <var>reading</var> argument, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value" id="ref-for-dfn-convert-ecmascript-to-idl-value③">converted to an IDL value</a> of the <var>type</var>’s
  associated <code class="idl"><a data-link-type="idl" href="#dictdef-mocksensorreadingvalues" id="ref-for-dictdef-mocksensorreadingvalues③">MockSensorReadingValues</a></code>. If this throws an exception, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors①③">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code①⓪">WebDriver error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-invalid-argument" id="ref-for-dfn-invalid-argument③">invalid argument</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-iterate" id="ref-for-map-iterate③">For each</a> <var>key</var> → <var>value</var> of <var>reading</var>.</p>
      <ol>
       <li data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-set" id="ref-for-map-set②">Set</a> <a data-link-type="dfn" href="#mock-sensor-reading" id="ref-for-mock-sensor-reading⑧">mock sensor reading</a>[<var>key</var>] to the corresponding value of <var>reading</var>.</p>
      </ol>
     <li data-md>
      <p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-success" id="ref-for-dfn-success②">success</a> with data <code>null</code>.</p>
    </ol>
   </div>
   <h4 class="heading settled" data-level="9.2.4" id="delete-mock-sensor-command"><span class="secno">9.2.4. </span><span class="content">Delete mock sensor</span><a class="self-link" href="#delete-mock-sensor-command"></a></h4>
   <table>
    <tbody>
     <tr>
      <th>HTTP Method
      <th><a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-extension-command-uri-template" id="ref-for-dfn-extension-command-uri-template③">URI Template</a>
     <tr>
      <td>DELETE
      <td>/session/{session id}/sensor/{type}
   </table>
   <div class="algorithm" data-algorithm="delete mock sensor">
    <p>The <dfn data-dfn-type="dfn" data-noexport id="delete-mock-sensor">delete mock sensor<a class="self-link" href="#delete-mock-sensor"></a></dfn> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-extension-command" id="ref-for-dfn-extension-command⑤">extension command</a> deletes
    a given type of <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor②⑨">mock sensor</a>.</p>
    <p>The <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-remote-end-steps" id="ref-for-dfn-remote-end-steps③">remote end steps</a> are:</p>
    <ol>
     <li data-md>
      <p>Let <var>type</var> be a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-url-variables" id="ref-for-dfn-url-variables②">url variable</a>.</p>
     <li data-md>
      <p>If <code class="idl"><a data-link-type="idl" href="#enumdef-mocksensortype" id="ref-for-enumdef-mocksensortype⑤">MockSensorType</a></code> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-contain" id="ref-for-list-contain③">does not contain</a> <var>type</var>, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors①④">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code①①">WebDriver error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-invalid-argument" id="ref-for-dfn-invalid-argument④">invalid argument</a>.</p>
     <li data-md>
      <p>If the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context①②">current browsing context</a> is <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-no-longer-open" id="ref-for-dfn-no-longer-open③">no longer open</a>, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors①⑤">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code①②">WebDriver error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-no-such-window" id="ref-for-dfn-no-such-window③">no such window</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-handle-any-user-prompts" id="ref-for-dfn-handle-any-user-prompts③">Handle any user prompts</a>, and return its value if it is a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors①⑥">WebDriver error</a>.</p>
     <li data-md>
      <p>If <var>type</var> does not match a <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type②⓪">mock sensor type</a> amongst all associated <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor③⓪">mock sensors</a> of the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context①③">current browsing context</a>, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-errors" id="ref-for-dfn-errors①⑦">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code①③">WebDriver error code</a> <a data-link-type="dfn" href="#no-such-mock-sensor" id="ref-for-no-such-mock-sensor②">no such mock sensor</a>.</p>
     <li data-md>
      <p>Delete <var>type</var> of <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor③①">mock sensor</a> in <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context①④">current browsing context</a>.</p>
     <li data-md>
      <p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-success" id="ref-for-dfn-success③">success</a> with data <code>null</code>.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="9.3" id="extension-handling-errors"><span class="secno">9.3. </span><span class="content">Handling errors</span><a class="self-link" href="#extension-handling-errors"></a></h3>
   <p>This section extends the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#handling-errors" id="ref-for-handling-errors">Handling Errors</a> and defines extended <a data-link-type="dfn" href="https://w3c.github.io/webdriver/#dfn-error-code" id="ref-for-dfn-error-code①④">WebDriver error codes</a> specific for <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor③②">mock sensor</a> in following table.</p>
   <table class="def" id="mock-sensor-error-code">
    <thead>
     <tr>
      <th>Error Code
      <th>HTTP Status
      <th>JSON Error Code
      <th>Description
    <tbody>
     <tr>
      <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="no-such-mock-sensor">no such mock sensor</dfn>
      <td>404
      <td><code>no such mock sensor</code>
      <td>no mock sensor matching the given type was found.
     <tr>
      <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="mock-sensor-already-created">mock sensor already created</dfn>
      <td>500
      <td><code>mock sensor already created</code>
      <td> A <a href="#section-extension-commands">command</a> to create a <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor③③">mock sensor</a> could not be
        satisfied because the given type of <a data-link-type="dfn" href="#mock-sensor" id="ref-for-mock-sensor③④">mock sensor</a> is already existed. 
   </table>
   <h2 class="heading settled" data-level="10" id="extensibility"><span class="secno">10. </span><span class="content">Extensibility</span><a class="self-link" href="#extensibility"></a></h2>
   <p><em>This section is non-normative.</em></p>
   <p class="note" role="note"><span>Note:</span> This section and its subsections provide guidance to <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification⑤">extension specification</a> <em>authors</em> using normative language. From <em>implementers'</em> point of view,
this section and its subsections are considered non-normative.</p>
   <p>This section describes how this specification can be extended to specify APIs for different <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type③⑤">sensor types</a>.</p>
   <p>Such <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="extension specification" data-noexport id="extension-specification">extension specifications</dfn> are encouraged to focus on a
single <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type③⑥">sensor type</a>, exposing both <a data-link-type="dfn" href="#high-level" id="ref-for-high-level⑦">high</a> and <a data-link-type="dfn" href="#low-level" id="ref-for-low-level⑦">low</a> level
as appropriate.</p>
   <p><a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification⑥">Extension specifications</a> are encouraged to define whether a <a data-link-type="dfn" href="#calibration" id="ref-for-calibration①">calibration</a> process applies to <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑤⓪">sensor readings</a>.</p>
   <p><a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification⑦">Extension specifications</a> may explicitly define the <a data-link-type="dfn" href="#local-coordinate-system" id="ref-for-local-coordinate-system④">local coordinate system</a> for the associated <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type③⑦">sensor type</a> or make it configurable per <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor③⑧">Sensor</a></code> object.</p>
   <p>For an up-to-date list of <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification⑧">extension specifications</a>, please refer to <a data-link-type="biblio" href="#biblio-generic-sensor-usecases">[GENERIC-SENSOR-USECASES]</a> and <a data-link-type="biblio" href="#biblio-motion-sensors">[MOTION-SENSORS]</a> documents.</p>
   <h3 class="heading settled" data-level="10.1" id="extension-security-and-privacy"><span class="secno">10.1. </span><span class="content">Security and Privacy</span><a class="self-link" href="#extension-security-and-privacy"></a></h3>
   <p><a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification⑨">Extension specifications</a> are expected to:</p>
   <ul>
    <li data-md>
     <p>conform with the generic <a href="#mitigation-strategies">mitigation strategies</a>,</p>
    <li data-md>
     <p>consider <a href="#mitigation-strategies-case-by-case">mitigation strategies applied
on a case by case basis</a>,</p>
    <li data-md>
     <p>be evaluated against the Self-Review Questionnaire on Security and Privacy <a data-link-type="biblio" href="#biblio-security-privacy-questionnaire">[SECURITY-PRIVACY-QUESTIONNAIRE]</a>,</p>
    <li data-md>
     <p>and in particular, be evaluated against the <a class="non-normative" data-link-type="dfn" href="https://w3ctag.github.io/security-questionnaire/#sop-violations" id="ref-for-sop-violations">same-origin policy violations</a> that can arise if sensors expose a new communication channel not governed
by the same-origin policy.</p>
   </ul>
   <h3 class="heading settled" data-level="10.2" id="naming"><span class="secno">10.2. </span><span class="content">Naming</span><a class="self-link" href="#naming"></a></h3>
   <p><code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor③⑨">Sensor</a></code> interfaces for <a data-link-type="dfn" href="#low-level" id="ref-for-low-level⑧">low-level</a> sensors should be
named after their associated <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor③⑥">platform sensor</a>.
So for example, the interface associated with a gyroscope
should be simply named <code>Gyroscope</code>. <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor④⓪">Sensor</a></code> interfaces for <a data-link-type="dfn" href="#high-level" id="ref-for-high-level⑧">high-level</a> sensors should be
named by combining the physical quantity the <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor③⑦">platform sensor</a> measures
with the "Sensor" suffix.
For example, a <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor③⑧">platform sensor</a> measuring
the distance at which an object is from it
may see its associated interface called <code>ProximitySensor</code>.</p>
   <p>Attributes of the <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor④①">Sensor</a></code> subclass that
hold <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑤①">sensor readings</a> values
should be named after the full name of these values.
For example, the <code>Thermometer</code> interface should hold
the <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑤②">sensor reading</a>'s value in
a <code>temperature</code> attribute (and not a <code>value</code> or <code>temp</code> attribute).
A good starting point for naming are the
Quantities, Units, Dimensions and Data Types Ontologies <a data-link-type="biblio" href="#biblio-qudt">[QUDT]</a>.</p>
   <h3 class="heading settled" data-level="10.3" id="unit"><span class="secno">10.3. </span><span class="content">Unit</span><a class="self-link" href="#unit"></a></h3>
   <p><a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification①⓪">Extension specifications</a> must specify the unit of <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑤③">sensor readings</a>.</p>
   <p>As per the Technical Architecture Group’s (TAG) API Design Principles <a data-link-type="biblio" href="#biblio-api-design-principles">[API-DESIGN-PRINCIPLES]</a>,
all time measurement should be in milliseconds.
All other units should be specified using,
in order of preference,
and with the exception of temperature (for which Celsius should be favored over Kelvin),
the International System of Units (SI),
SI derived units, and
Non-SI units accepted for use with the SI,
as described in the SI Brochure <a data-link-type="biblio" href="#biblio-si">[SI]</a>.</p>
   <h3 class="heading settled" data-level="10.4" id="high-vs-low-level"><span class="secno">10.4. </span><span class="content">Exposing High-Level vs. Low-Level Sensors</span><a class="self-link" href="#high-vs-low-level"></a></h3>
   <p>So far, specifications exposing sensors to the Web platform
have focused on <a data-link-type="dfn" href="#high-level" id="ref-for-high-level⑨">high-level</a> sensors APIs. <a data-link-type="biblio" href="#biblio-geolocation-api">[GEOLOCATION-API]</a> <a data-link-type="biblio" href="#biblio-orientation-event">[ORIENTATION-EVENT]</a></p>
   <p>This was a reasonable approach for a number of reasons.
Indeed, <a data-link-type="dfn" href="#high-level" id="ref-for-high-level①⓪">high-level</a> sensors:</p>
   <ul>
    <li data-md>
     <p>convey developer intent clearly,</p>
    <li data-md>
     <p>do not require intimate knowledge of how the underlying hardware sensors functions,</p>
    <li data-md>
     <p>are easy to use,</p>
    <li data-md>
     <p>may enable the User Agent to make significant
  performance and battery life improvements,</p>
    <li data-md>
     <p>help avoid certain privacy and security issues by
  decreasing the amount and type of information exposed.</p>
   </ul>
   <p>However, an increasing number of use cases
such as virtual and augmented reality
require <a data-link-type="dfn" href="#low-level" id="ref-for-low-level⑨">low-level</a> access to sensors,
most notably for performance reasons.</p>
   <p>Providing <a data-link-type="dfn" href="#low-level" id="ref-for-low-level①⓪">low-level</a> access
enables Web application developers to leverage domain-specific constraints
and design more performant systems.</p>
   <p>Following the precepts of the Extensible Web Manifesto <a data-link-type="biblio" href="#biblio-extennnnsible">[EXTENNNNSIBLE]</a>, <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification①①">extension specifications</a> should focus primarily on
exposing <a data-link-type="dfn" href="#low-level" id="ref-for-low-level①①">low-level</a> sensor APIs, but should also expose <a data-link-type="dfn" href="#high-level" id="ref-for-high-level①①">high-level</a> APIs when they are clear benefits in doing so.</p>
   <h3 class="heading settled" data-level="10.5" id="multiple-sensors"><span class="secno">10.5. </span><span class="content">When is Enabling Multiple Sensors of the Same Type Not the Right Choice?</span><a class="self-link" href="#multiple-sensors"></a></h3>
   <p>It is not advisable to construct multiple <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor④②">Sensor</a></code> instances of the same <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type③⑧">sensor type</a> with
equal construction parameters, as it can lead to unnecessary hardware resources consumption.</p>
   <p>In cases when multiple observers are interested in notifications of a newly available <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑤④">sensor reading</a>, an <a data-link-type="dfn" href="https://dom.spec.whatwg.org#concept-event-listener" id="ref-for-concept-event-listener①">event listener</a> can be added on a single <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor④③">Sensor</a></code> instance instead of
creating multiple instances of the same <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type③⑨">sensor type</a> and using simple <code class="idl"><a data-link-type="idl" href="#dom-sensor-onreading" id="ref-for-dom-sensor-onreading①">onreading</a></code> event
handler.</p>
   <p>Conversely, multiple <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor④④">Sensors</a></code> of the same <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type④⓪">sensor type</a> can be created when they
are intended to be used with different settings, such as: <a data-link-type="dfn" href="#requested-sampling-frequency" id="ref-for-requested-sampling-frequency①②">requested sampling frequency</a>,
accuracy or other settings defined in <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification①②">extension specifications</a>.</p>
   <h3 class="heading settled" data-level="10.6" id="definition-reqs"><span class="secno">10.6. </span><span class="content">Definition Requirements</span><a class="self-link" href="#definition-reqs"></a></h3>
   <p>The following definitions must be specified for
each <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type④①">sensor type</a> in <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification①③">extension specifications</a>:</p>
   <ul>
    <li data-md>
     <p>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="extension-sensor-interface">extension sensor interface</dfn>, which is an <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-interface" id="ref-for-dfn-interface">interface</a> whose <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-inherited-interfaces" id="ref-for-dfn-inherited-interfaces">inherited interfaces</a> contains <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor④⑤">Sensor</a></code>.
  The <a data-link-type="dfn" href="#extension-sensor-interface" id="ref-for-extension-sensor-interface④">extension sensor interface</a> must be constructible.
  Its [<code class="idl"><a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Constructor" id="ref-for-Constructor">Constructor</a></code>] must take, as an argument,
  an optional <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary" id="ref-for-dfn-dictionary①">dictionary</a> whose <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-inherited-dictionaries" id="ref-for-dfn-inherited-dictionaries">inherited dictionaries</a> contains <code class="idl"><a data-link-type="idl" href="#dictdef-sensoroptions" id="ref-for-dictdef-sensoroptions①">SensorOptions</a></code>.</p>
     <p>The <a data-link-type="dfn" href="#extension-sensor-interface" id="ref-for-extension-sensor-interface⑤">extension sensor interface</a> has a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set①①">set</a> of supported options
  referred to as <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="supported-sensor-options">supported sensor options</dfn>.
  Unless the <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification①④">extension specification</a> defines otherwise, <a data-link-type="dfn" href="#supported-sensor-options" id="ref-for-supported-sensor-options①">supported sensor options</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-contain" id="ref-for-list-contain④">contain</a> a single item which is "frequency".</p>
     <p>The user agent must remove items from <a data-link-type="dfn" href="#supported-sensor-options" id="ref-for-supported-sensor-options②">supported sensor options</a> for a given <a data-link-type="dfn" href="#extension-sensor-interface" id="ref-for-extension-sensor-interface⑥">extension sensor interface</a> if it cannot support the corresponding sensor
  options.</p>
     <p>The <a data-link-type="dfn" href="#extension-sensor-interface" id="ref-for-extension-sensor-interface⑦">extension sensor interface</a> <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-attribute" id="ref-for-dfn-attribute④">attributes</a> which expose <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑤⑤">sensor readings</a> are <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-read-only" id="ref-for-dfn-read-only">read only</a> and their getters must return the result of invoking <a data-link-type="dfn" href="#get-value-from-latest-reading" id="ref-for-get-value-from-latest-reading③">get value from latest reading</a> with <strong>this</strong> and <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-attribute" id="ref-for-dfn-attribute⑤">attribute</a> <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-identifier" id="ref-for-dfn-identifier④">identifier</a> as arguments.</p>
    <li data-md>
     <p>A <a data-link-type="dfn" href="https://www.w3.org/TR/permissions/#enumdef-permissionname" id="ref-for-enumdef-permissionname④">permission name</a>, if the <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type④②">sensor type</a> is not representing <a data-link-type="dfn" href="#sensor-fusion" id="ref-for-sensor-fusion⑧">sensor fusion</a> (otherwise, <a data-link-type="dfn" href="https://www.w3.org/TR/permissions/#enumdef-permissionname" id="ref-for-enumdef-permissionname⑤">permission names</a> associated with the fusion source <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type④③">sensor types</a> must be used).</p>
   </ul>
   <p>An <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification①⑤">extension specification</a> may specify the following definitions
for each <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type④④">sensor types</a>:</p>
   <ul>
    <li data-md>
     <p>A <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-dictionary" id="ref-for-dfn-dictionary②">dictionary</a> whose <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-inherited-dictionaries" id="ref-for-dfn-inherited-dictionaries①">inherited dictionaries</a> contains <code class="idl"><a data-link-type="idl" href="#dictdef-sensoroptions" id="ref-for-dictdef-sensoroptions②">SensorOptions</a></code>.</p>
    <li data-md>
     <p>A <a data-link-type="dfn" href="#default-sensor" id="ref-for-default-sensor⑥">default sensor</a>. Generally, devices are equipped with a single <a data-link-type="dfn" href="#concept-platform-sensor" id="ref-for-concept-platform-sensor③⑨">platform sensor</a> of each <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type④⑤">type</a>,
  so defining a <a data-link-type="dfn" href="#default-sensor" id="ref-for-default-sensor⑦">default sensor</a> should be straightforward.
  For <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type④⑥">sensor types</a> where multiple <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor③②">sensors</a> are common, <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification①⑥">extension specifications</a> may choose not to define a <a data-link-type="dfn" href="#default-sensor" id="ref-for-default-sensor⑧">default sensor</a>,
  especially when doing so would not make sense.</p>
   </ul>
   <h3 class="heading settled" data-level="10.7" id="extend-automation"><span class="secno">10.7. </span><span class="content">Automation</span><a class="self-link" href="#extend-automation"></a></h3>
   <p>In order to enable user-agent automation and application testing, <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification①⑦">extension specifications</a> are encouraged to:</p>
   <ul>
    <li data-md>
     <p>Add new <a data-link-type="dfn" href="#mock-sensor-type" id="ref-for-mock-sensor-type②①">mock sensor type</a> for each <a data-link-type="dfn" href="#extension-sensor-interface" id="ref-for-extension-sensor-interface⑧">extension sensor interface</a> to the <code class="idl"><a data-link-type="idl" href="#enumdef-mocksensortype" id="ref-for-enumdef-mocksensortype⑥">MockSensorType</a></code> enum.</p>
    <li data-md>
     <p>Define a <a data-link-type="dfn" href="#mock-sensor-reading-values" id="ref-for-mock-sensor-reading-values①">mock sensor reading values</a> dictionary.</p>
   </ul>
   <h3 class="heading settled" data-level="10.8" id="permission-api"><span class="secno">10.8. </span><span class="content">Extending the Permission API</span><a class="self-link" href="#permission-api"></a></h3>
   <p>An implementation of the <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor④⑥">Sensor</a></code> interface for each <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type④⑦">sensor type</a> must protect its <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑤⑥">reading</a> by associated <a data-link-type="dfn" href="https://www.w3.org/TR/permissions/#enumdef-permissionname" id="ref-for-enumdef-permissionname⑥">permission name</a> or <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor">PermissionDescriptor</a></code>.
A <a data-link-type="dfn" href="#low-level" id="ref-for-low-level①②">Low-level</a> <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor④⑦">sensor</a></code> may use its interface name as a <a data-link-type="dfn" href="https://www.w3.org/TR/permissions/#enumdef-permissionname" id="ref-for-enumdef-permissionname⑦">permission name</a>,
for instance, "gyroscope" or "accelerometer". <a data-link-type="dfn" href="#sensor-fusion" id="ref-for-sensor-fusion⑨">Fusion sensors</a> must <a data-link-type="dfn" href="https://w3c.github.io/permissions/#request-permission-to-use" id="ref-for-request-permission-to-use①">request permission to access</a> each of the sensors that are
used as a source of fusion.</p>
   <p>Even though it might be difficult to reconstruct <a data-link-type="dfn" href="#low-level" id="ref-for-low-level①③">low-level</a> <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑤⑦">sensor readings</a> from
fused data, some of the original information might be inferred. For example, it is easy to
deduce user’s orientation in space if absolute or geomagnetic orientation sensors are used,
therefore, these sensors must <a data-link-type="dfn" href="https://w3c.github.io/permissions/#request-permission-to-use" id="ref-for-request-permission-to-use②">request permission to use</a> magnetometer as it provides information about orientation of device in relation to Earth’s
magnetic field. In contrast, relative orientation sensor does not expose such information, thus,
it does not need to <a data-link-type="dfn" href="https://w3c.github.io/permissions/#request-permission-to-use" id="ref-for-request-permission-to-use③">request permission to use</a> magnetometer.</p>
   <p><code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor①">Permission descriptors</a></code> can also be used to set maximum allowed limits
for accuracy or <a data-link-type="dfn" href="#sampling-frequency" id="ref-for-sampling-frequency①⑦">sampling frequency</a>. An example for a possible extension of the Permission API
for accelerometer sensor is given below.</p>
<pre class="example" id="example-88a9149d"><a class="self-link" href="#example-88a9149d"></a>dictionary AccelerometerPermissionDescriptor : PermissionDescriptor {
    boolean highAccuracy = false;
    boolean highFrequency = false;
};
</pre>
   <h3 class="heading settled" data-level="10.9" id="feature-policy-api"><span class="secno">10.9. </span><span class="content">Extending the Feature Policy API</span><a class="self-link" href="#feature-policy-api"></a></h3>
   <p>An implementation of the <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor④⑧">Sensor</a></code> interface for each <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type④⑧">sensor type</a> has one
(if <a data-link-type="dfn" href="#sensor-fusion" id="ref-for-sensor-fusion①⓪">sensor fusion</a> is not performed) or several <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature④">policy-controlled features</a> that control whether or not this implementation can be used in a document.</p>
   <p>The <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature⑤">features</a>' <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#default-allowlist" id="ref-for-default-allowlist">default allowlist</a> is <code>["self"]</code>.</p>
   <p class="note" role="note"><span>Note:</span> The <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#default-allowlist" id="ref-for-default-allowlist①">default allowlist</a> of <code>["self"]</code> allows <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor④⑨">Sensor</a></code> interface
implementation usage in same-origin nested frames but prevents third-party content
from <a data-link-type="dfn" href="#sensor-reading" id="ref-for-sensor-reading⑤⑧">sensor readings</a> access.</p>
   <p>The <a data-link-type="dfn" href="#sensor-feature-names" id="ref-for-sensor-feature-names②">sensor feature names</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set①②">set</a> must contain <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature⑥">policy-controlled feature</a> tokens of every associated <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature⑦">feature</a>.</p>
   <p>A <a data-link-type="dfn" href="#low-level" id="ref-for-low-level①④">Low-level</a> <code class="idl"><a data-link-type="idl" href="#sensor" id="ref-for-sensor⑤⓪">sensor</a></code> may use its interface name as a <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature⑧">policy-controlled feature</a> token,
for instance, "gyroscope" or "accelerometer". Unless the <a data-link-type="dfn" href="#extension-specification" id="ref-for-extension-specification①⑧">extension specification</a> defines
otherwise, the <a data-link-type="dfn" href="#sensor-feature-names" id="ref-for-sensor-feature-names③">sensor feature names</a> matches the same <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type④⑨">type</a>-associated <a data-link-type="dfn" href="#sensor-permission-names" id="ref-for-sensor-permission-names③">sensor permission names</a>.</p>
   <div class="example html" id="example-07bc76ef">
    <a class="self-link" href="#example-07bc76ef"></a> The accelerometer feature is selectively enabled for third-party origin by adding <a data-link-type="dfn" href="https://w3c.github.io/webappsec-feature-policy/#iframe-allow-attribute" id="ref-for-iframe-allow-attribute">allow attribute</a> to the frame container element: 
<pre class="highlight"><c- p>&lt;</c-><c- f>iframe</c-> <c- e>src</c-><c- o>=</c-><c- s>"https://third-party.com"</c-> <c- e>allow</c-><c- o>=</c-><c- s>"accelerometer"</c-><c- p>/>&lt;/</c-><c- f>iframe</c-><c- p>></c->
</pre>
   </div>
   <div class="example html" id="example-a3ba22ce">
    <a class="self-link" href="#example-a3ba22ce"></a> A sensor usage is disabled completely by specifying the feature policy in a HTTP
response header: 
<pre class="highlight">Feature<c- o>-</c->Policy<c- o>:</c-> accelerometer <c- t>'none'</c->
</pre>
   </div>
   <p><a data-link-type="dfn" href="#sensor-fusion" id="ref-for-sensor-fusion①①">Fusion sensors</a> must use <a data-link-type="dfn" href="#sensor-feature-names" id="ref-for-sensor-feature-names④">sensor feature names</a> of the sensors
that are used as a source of fusion.</p>
   <div class="example html" id="example-dcbd0b33">
    <a class="self-link" href="#example-dcbd0b33"></a> Allow third-party origin to use accelerometer, magnetometer and gyroscope features
that are required by the absolute orientation sensor. 
<pre class="highlight"><c- p>&lt;</c-><c- f>iframe</c-> <c- e>src</c-><c- o>=</c-><c- s>"https://third-party.com"</c-> <c- e>allow</c-><c- o>=</c-><c- s>"accelerometer; magnetometer; gyroscope"</c-><c- p>/></c->
</pre>
   </div>
   <h3 class="heading settled" data-level="10.10" id="example-webidl"><span class="secno">10.10. </span><span class="content">Example WebIDL</span><a class="self-link" href="#example-webidl"></a></h3>
   <p>Here’s an example WebIDL for a possible extension of this specification
for proximity <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor③③">sensors</a>.</p>
<pre class="example" id="example-ce90960e"><a class="self-link" href="#example-ce90960e"></a>[SecureContext, Exposed=Window]
interface ProximitySensor : Sensor {
    constructor(optional ProximitySensorOptions proximitySensorOptions = {});
    readonly attribute double? distance;
};

dictionary ProximitySensorOptions : SensorOptions {
    double min;
    double max;
    ProximitySensorPosition position;
    ProximitySensorDirection direction;
};

enum ProximitySensorPosition {
    "top-left",
    "top",
    "top-right",
    "middle-left",
    "middle",
    "middle-right",
    "bottom-left",
    "bottom",
    "bottom-right"
};

enum ProximitySensorDirection {
    "front",
    "rear",
    "left",
    "right",
    "top",
    "bottom"
};
</pre>
   <h2 class="heading settled" data-level="11" id="acknowledgements"><span class="secno">11. </span><span class="content">Acknowledgements</span><a class="self-link" href="#acknowledgements"></a></h2>
   <p>First and foremost, I would like to thank Anssi Kostiainen
for his continuous and dedicated support and input throughout
the development of this specification, as well as Mikhail Pozdnyakov,
Alexander Shalamov, Rijubrata Bhaumik, and Kenneth Rohde Christiansen
for their invaluable implementation feedback, suggestions, and research
that have helped inform the specification work.</p>
   <p>Special thanks to Rick Waldron for
driving the discussion around a generic sensor API design for the Web,
sketching the original API on which this is based,
providing implementation feedback from his work on Johnny-Five,
and continuous input during the development of this specification.</p>
   <p>Special thanks to Boris Smus, Tim Volodine, and Rich Tibbett
for their initial work on exposing sensors to the web with consistency.</p>
   <p>Thanks to Anne van Kesteren
for his tireless help both in person and through IRC.</p>
   <p>Thanks to Domenic Denicola and Jake Archibald for their help.</p>
   <p>Thanks also to Frederick Hirsch and Dominique Hazaël-Massieux (via the HTML5Apps project)
for both their administrative help and technical input.</p>
   <p>Thanks to Tab Atkins for making Bikeshed and taking the time to explain its subtleties.</p>
   <p>Thanks to Lukasz Olejnik and Maryam Mehrnezhad for their contributions around privacy and security.</p>
   <p>The following people have greatly contributed to this specification through extensive discussions on GitHub:
Anssi Kostiainen,
Boris Smus,
chaals,
Claes Nilsson,
Dave Raggett,
David Mark Clements,
Domenic Denicola,
Dominique Hazaël-Massieux (via the HTML5Apps project),
Francesco Iovine,
Frederick Hirsch,
gmandyam,
Jafar Husain,
Johannes Hund,
Kris Kowal,
Lukasz Olejnik,
Marcos Caceres,
Marijn Kruisselbrink,
Mark Foltz,
Mats Wichmann,
Matthew Podwysocki,
Olli Pettay,
pablochacin,
Remy Sharp,
Rich Tibbett,
Rick Waldron,
Rijubrata Bhaumik,
robman,
Sean T. McBeth,
Tab Atkins Jr.,
Virginie Galindo,
zenparsing,
and Zoltan Kis.</p>
   <p>We’d also like to thank
Anssi Kostiainen,
Dominique Hazaël-Massieux,
Erik Wilde,
and
Michael[tm] Smith
for their editorial input.</p>
   <h2 class="no-ref no-num heading settled" id="conformance"><span class="content">Conformance</span><a class="self-link" href="#conformance"></a></h2>
   <h3 class="no-ref no-num heading settled" id="conventions"><span class="content">Document conventions</span><a class="self-link" href="#conventions"></a></h3>
   <p>Conformance requirements are expressed with a combination of
    descriptive assertions and RFC 2119 terminology. The key words "MUST",
    "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
    "RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this
    document are to be interpreted as described in RFC 2119.
    However, for readability, these words do not appear in all uppercase
    letters in this specification. </p>
   <p>All of the text of this specification is normative except sections
    explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a></p>
   <p>Examples in this specification are introduced with the words "for example"
    or are set apart from the normative text with <code>class="example"</code>,
    like this: </p>
   <div class="example" id="example-ae2b6bc0">
    <a class="self-link" href="#example-ae2b6bc0"></a> 
    <p>This is an example of an informative example.</p>
   </div>
   <p>Because this document doesn’t itself define APIs for specific <a data-link-type="dfn" href="#sensor-type" id="ref-for-sensor-type⑤⓪">sensor types</a>—<wbr>that is the role of extensions to this specification—<wbr>all examples are inevitably (wishful) fabrications.
    Although all of the <a data-link-type="dfn" href="#concept-device-sensor" id="ref-for-concept-device-sensor③④">sensors</a> used a examples
    would be great candidates for building atop the Generic Sensor API,
    their inclusion in this document does not imply that the relevant Working Groups
    are planning to do so. </p>
   <p>Informative notes begin with the word "Note" and are set apart from the
    normative text with <code>class="note"</code>, like this: </p>
   <p class="note" role="note">Note, this is an informative note.</p>
   <h3 class="no-ref no-num heading settled" id="conformant-algorithms"><span class="content">Conformant Algorithms</span><a class="self-link" href="#conformant-algorithms"></a></h3>
   <p>Requirements phrased in the imperative as part of algorithms (such as
    "strip any leading space characters" or "return false")
    are to be interpreted with the meaning of the key word ("must",
    "should", "may", etc) used in introducing the algorithm.</p>
   <p>Conformance requirements phrased as algorithms or specific steps can be
    implemented in any manner, so long as the end result is <dfn data-dfn-type="dfn" data-noexport id="equivalent">equivalent<a class="self-link" href="#equivalent"></a></dfn>. In
    particular, the algorithms defined in this specification are intended to
    be easy to understand and are not intended to be performant. Implementers
    are encouraged to optimize.</p>
   <h3 class="no-ref no-num heading settled" id="conformance-classes"><span class="content">Conformance Classes</span><a class="self-link" href="#conformance-classes"></a></h3>
   <p>A <dfn data-dfn-type="dfn" data-noexport id="conformant-user-agent">conformant user agent<a class="self-link" href="#conformant-user-agent"></a></dfn> must implement all the requirements
    listed in this specification that are applicable to user agents.</p>
<script>
    // Scrollspy
    var createScrollSpy = (function() {

        function targetId(element) {
            return (element.href || "").split("#")[1] || null;
        }

        function getScrollTop() {
            return (window.pageYOffset !== undefined)
                ? window.pageYOffset
                : (document.documentElement || document.body.parentNode || document.body).scrollTop;
        }

        function addClassToParents(element, className, parentClassName) {
            do {
                element = element.parentNode;
            } while (element && element.tagName != "LI")
            if (element) {
                var a = element.querySelector("a");
                if (a) a.className = className;
                addClassToParents(element, parentClassName ? parentClassName : className);
            }
        }

        function getPosition(element, container) {
            var eR = element.getBoundingClientRect();
            var cR = container.getBoundingClientRect();
            if (eR.bottom < cR.top) return "above";
            if (eR.top > cR.bottom) return "below";
            return "visible";
        }

        function createScrollSpy(options) {
            options = options || {};

            var OFFSET = 80,
                needsUpdate = false,
                previous = null,
                current = null,
                currentNav = null,
                tocContainer,
                toc,
                sections;

            tocContainer = document.querySelector(options.id);
            toc = [].slice.call(tocContainer.querySelectorAll("a"), 0);
            sections = toc.reduce(function(sections, a) {
                var id = targetId(a);
                var section = id ? document.getElementById(id) : null;
                if (section) { sections.push(section); }
                return sections;
            }, []);

            function onscroll() {
                if (!needsUpdate) {
                    needsUpdate = true;
                    requestAnimationFrame(updatePosition);
                }
            }

            function updatePosition() {
                needsUpdate = false;
                var scrollTop = (options.offset || 0) + getScrollTop();
                current = sections.filter(function(section){
                    return section.offsetTop < scrollTop;
                }).pop();
                current = current ? current.id : null;

                if (previous !== current) {
                    previous = current;
                    toc.forEach(function(a) {
                        if (targetId(a) == current) {
                            currentNav = a;
                        } else {
                            a.className = "";
                        }
                    });
                    if (options.markParents) {
                        addClassToParents(currentNav, options.className, options.parentClassName)
                    } else {
                        currentNav.className = options.className;
                    }
                    if (options.scrollIntoView && typeof currentNav.scrollIntoView == "function") {
                        var p = getPosition(currentNav, tocContainer);
                        if (p == "above") {
                            currentNav.scrollIntoView(true);
                        } else if (p == "below") {
                            currentNav.scrollIntoView(false);
                        }
                    }
                }
            }

            return {
                start: function() {
                    window.addEventListener("scroll", onscroll, false);
                },

                stop: function() {
                    window.removeEventListener("scroll", onscroll, false);
                    toc.forEach(function(a) {
                        a.className = "";
                    });
                }
            }
        }

        return createScrollSpy;
    })();

    (function() {
        var spy = createScrollSpy({
            offset: 80,
            id: "#toc",
            className: "current",
            parentClassName: "current-parent",
            markParents: true,
            scrollIntoView: true
        });

        var mm = window.matchMedia('screen and (min-width: 78em)');
        if (mm.matches) {
            spy.start();
        }
        mm.addListener(function(m) {
            if (m.matches) spy.start();
            else spy.stop();
        });
    })();
</script>
  </main>
<script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li><a href="#dom-mocksensortype-absolute-orientation">"absolute-orientation"</a><span>, in §9.1.3</span>
   <li><a href="#dom-mocksensortype-accelerometer">"accelerometer"</a><span>, in §9.1.3</span>
   <li><a href="#activate-a-sensor-object">Activate a sensor object</a><span>, in §8.3</span>
   <li><a href="#dom-sensor-activated">activated</a><span>, in §7.1</span>
   <li><a href="#activated-sensor-objects">activated sensor objects</a><span>, in §6.2</span>
   <li><a href="#dom-mocksensortype-ambient-light">"ambient-light"</a><span>, in §9.1.3</span>
   <li><a href="#associated-sensors">associated sensors</a><span>, in §6.1</span>
   <li><a href="#biaxial">biaxial</a><span>, in §5.1</span>
   <li><a href="#calibration">calibration</a><span>, in §5.1</span>
   <li><a href="#can-expose-sensor-readings">can expose sensor readings</a><span>, in §5.6</span>
   <li><a href="#check-sensor-policy-controlled-features">Check sensor policy-controlled features</a><span>, in §8.1</span>
   <li><a href="#conformant-user-agent">conformant user agent</a><span>, in §Unnumbered section</span>
   <li><a href="#dom-mocksensorconfiguration-connected">connected</a><span>, in §9.1.1</span>
   <li><a href="#connection-flag">connection flag</a><span>, in §9.1.1</span>
   <li><a href="#connect-to-sensor">Connect to sensor</a><span>, in §8.2</span>
   <li><a href="#dom-sensorerrorevent-sensorerrorevent">constructor(type, errorEventInitDict)</a><span>, in §7.2</span>
   <li><a href="#create-mock-sensor">create mock sensor</a><span>, in §9.2.1</span>
   <li><a href="#deactivate-a-sensor-object">Deactivate a sensor object</a><span>, in §8.4</span>
   <li><a href="#default-sensor">default sensor</a><span>, in §5.3</span>
   <li><a href="#delete-mock-sensor">delete mock sensor</a><span>, in §9.2.4</span>
   <li><a href="#concept-device-sensor">device sensor</a><span>, in §5.1</span>
   <li><a href="#equivalent">equivalent</a><span>, in §Unnumbered section</span>
   <li>
    error
    <ul>
     <li><a href="#dom-sensorerrorevent-error">attribute for SensorErrorEvent</a><span>, in §7.2</span>
     <li><a href="#dom-sensorerroreventinit-error">dict-member for SensorErrorEventInit</a><span>, in §7.2</span>
    </ul>
   <li><a href="#extension-sensor-interface">extension sensor interface</a><span>, in §10.6</span>
   <li><a href="#extension-specification">extension specification</a><span>, in §10</span>
   <li><a href="#find-the-reporting-frequency-of-a-sensor-object">Find the reporting frequency of a sensor object</a><span>, in §8.8</span>
   <li><a href="#dom-sensoroptions-frequency">frequency</a><span>, in §7.1</span>
   <li><a href="#dom-sensor-frequency-slot">[[frequency]]</a><span>, in §7.1.3</span>
   <li><a href="#generic-sensor-permission-revocation-algorithm">generic sensor permission revocation algorithm</a><span>, in §6.1</span>
   <li><a href="#dom-mocksensortype-geolocation">"geolocation"</a><span>, in §9.1.3</span>
   <li><a href="#get-mock-sensor">get mock sensor</a><span>, in §9.2.2</span>
   <li><a href="#get-value-from-latest-reading">Get value from latest reading</a><span>, in §8.13</span>
   <li><a href="#dom-mocksensortype-gravity">"gravity"</a><span>, in §9.1.3</span>
   <li><a href="#dom-mocksensortype-gyroscope">"gyroscope"</a><span>, in §9.1.3</span>
   <li><a href="#dom-sensor-hasreading">hasReading</a><span>, in §7.1</span>
   <li><a href="#high-level">high-level</a><span>, in §5.2</span>
   <li><a href="#initialize-a-sensor-object">Initialize a sensor object</a><span>, in §8</span>
   <li><a href="#dom-sensor-lasteventfiredat-slot">[[lastEventFiredAt]]</a><span>, in §7.1.3</span>
   <li><a href="#latest-reading">latest reading</a><span>, in §6.2</span>
   <li><a href="#limit-max-frequency">Limit maximum sampling frequency</a><span>, in §4.3</span>
   <li><a href="#limit-number-of-delivered-readings">Limit number of delivered readings</a><span>, in §4.3.2</span>
   <li><a href="#dom-mocksensortype-linear-acceleration">"linear-acceleration"</a><span>, in §9.1.3</span>
   <li><a href="#local-coordinate-system">local coordinate system</a><span>, in §5.1</span>
   <li><a href="#low-level">low-level</a><span>, in §5.2</span>
   <li><a href="#dom-mocksensortype-magnetometer">"magnetometer"</a><span>, in §9.1.3</span>
   <li><a href="#mandatory-conditions">mandatory conditions</a><span>, in §5.6</span>
   <li>
    maxSamplingFrequency
    <ul>
     <li><a href="#dom-mocksensor-maxsamplingfrequency">dict-member for MockSensor</a><span>, in §9.1.2</span>
     <li><a href="#dom-mocksensorconfiguration-maxsamplingfrequency">dict-member for MockSensorConfiguration</a><span>, in §9.1.1</span>
    </ul>
   <li>
    minSamplingFrequency
    <ul>
     <li><a href="#dom-mocksensor-minsamplingfrequency">dict-member for MockSensor</a><span>, in §9.1.2</span>
     <li><a href="#dom-mocksensorconfiguration-minsamplingfrequency">dict-member for MockSensorConfiguration</a><span>, in §9.1.1</span>
    </ul>
   <li><a href="#dictdef-mocksensor">MockSensor</a><span>, in §9.1.2</span>
   <li><a href="#mock-sensor">mock sensor</a><span>, in §9.1</span>
   <li><a href="#mock-sensor-already-created">mock sensor already created</a><span>, in §9.3</span>
   <li><a href="#dictdef-mocksensorconfiguration">MockSensorConfiguration</a><span>, in §9.1.1</span>
   <li><a href="#mock-sensor-reading">mock sensor reading</a><span>, in §9.1</span>
   <li><a href="#dictdef-mocksensorreadingvalues">MockSensorReadingValues</a><span>, in §9.1.3</span>
   <li><a href="#mock-sensor-reading-values">Mock Sensor Reading Values</a><span>, in §9.1.3</span>
   <li><a href="#enumdef-mocksensortype">MockSensorType</a><span>, in §9.1.3</span>
   <li><a href="#dom-mocksensorconfiguration-mocksensortype">mockSensorType</a><span>, in §9.1.1</span>
   <li><a href="#mock-sensor-type">mock sensor type</a><span>, in §9.1.3</span>
   <li><a href="#no-such-mock-sensor">no such mock sensor</a><span>, in §9.3</span>
   <li><a href="#notify-activated-state">Notify activated state</a><span>, in §8.11</span>
   <li><a href="#notify-error">Notify error</a><span>, in §8.12</span>
   <li><a href="#notify-new-reading">Notify new reading</a><span>, in §8.10</span>
   <li><a href="#dom-sensor-onactivate">onactivate</a><span>, in §7.1</span>
   <li><a href="#dom-sensor-onerror">onerror</a><span>, in §7.1</span>
   <li><a href="#dom-sensor-onreading">onreading</a><span>, in §7.1</span>
   <li><a href="#optimal-sampling-frequency">optimal sampling frequency</a><span>, in §6.2</span>
   <li><a href="#dom-sensor-pendingreadingnotification-slot">[[pendingReadingNotification]]</a><span>, in §7.1.3</span>
   <li><a href="#concept-platform-sensor">platform sensor</a><span>, in §5.1</span>
   <li><a href="#dom-mocksensortype-proximity">"proximity"</a><span>, in §9.1.3</span>
   <li><a href="#reading-change-threshold">reading change threshold</a><span>, in §5.4</span>
   <li><a href="#reading-timestamp">reading timestamp</a><span>, in §5.1</span>
   <li><a href="#reading-value">reading value</a><span>, in §5.1</span>
   <li><a href="#reduce-accuracy">Reduce accuracy</a><span>, in §4.3.3</span>
   <li><a href="#dom-mocksensortype-relative-orientation">"relative-orientation"</a><span>, in §9.1.3</span>
   <li><a href="#reporting-frequency">reporting frequency</a><span>, in §5.5</span>
   <li><a href="#report-latest-reading-updated">Report latest reading updated</a><span>, in §8.9</span>
   <li><a href="#dom-mocksensor-requestedsamplingfrequency">requestedSamplingFrequency</a><span>, in §9.1.2</span>
   <li><a href="#requested-sampling-frequency">requested sampling frequency</a><span>, in §5.5</span>
   <li><a href="#request-sensor-access">Request sensor access</a><span>, in §8.14</span>
   <li><a href="#revoke-sensor-permission">Revoke sensor permission</a><span>, in §8.5</span>
   <li><a href="#sampling-frequency">sampling frequency</a><span>, in §5.5</span>
   <li><a href="#sensor">Sensor</a><span>, in §7.1</span>
   <li><a href="#sensorerrorevent">SensorErrorEvent</a><span>, in §7.2</span>
   <li><a href="#dictdef-sensorerroreventinit">SensorErrorEventInit</a><span>, in §7.2</span>
   <li><a href="#dom-sensorerrorevent-sensorerrorevent">SensorErrorEvent(type, errorEventInitDict)</a><span>, in §7.2</span>
   <li><a href="#sensor-feature-names">sensor feature names</a><span>, in §6.1</span>
   <li><a href="#sensor-fusion">sensor fusion</a><span>, in §5.2</span>
   <li><a href="#sensor-hubs">sensor hubs</a><span>, in §5.2</span>
   <li><a href="#dictdef-sensoroptions">SensorOptions</a><span>, in §7.1</span>
   <li><a href="#sensor-permission-names">sensor permission names</a><span>, in §6.1</span>
   <li><a href="#sensor-reading">sensor reading</a><span>, in §5.1</span>
   <li><a href="#sensor-task-source">sensor task source</a><span>, in §7.1</span>
   <li><a href="#sensor-type">sensor type</a><span>, in §6.1</span>
   <li><a href="#serialized-mock-sensor">serialized mock sensor</a><span>, in §9.1.2</span>
   <li><a href="#set-sensor-settings">Set sensor settings</a><span>, in §8.6</span>
   <li><a href="#smart-sensors">Smart sensors</a><span>, in §5.2</span>
   <li><a href="#spatial-sensor">spatial sensor</a><span>, in §5.1</span>
   <li><a href="#specific-conditions">Specific conditions</a><span>, in §5.6</span>
   <li><a href="#dom-sensor-start">start()</a><span>, in §7.1</span>
   <li><a href="#dom-sensor-state-slot">[[state]]</a><span>, in §7.1.3</span>
   <li><a href="#dom-sensor-stop">stop()</a><span>, in §7.1</span>
   <li><a href="#stop-sensor">Stop the sensor altogether</a><span>, in §4.3.1</span>
   <li><a href="#supported-sensor-options">supported sensor options</a><span>, in §10.6</span>
   <li><a href="#dom-sensor-timestamp">timestamp</a><span>, in §7.1</span>
   <li><a href="#triaxial">triaxial</a><span>, in §5.1</span>
   <li><a href="#dom-mocksensortype-uncalibrated-magnetometer">"uncalibrated-magnetometer"</a><span>, in §9.1.3</span>
   <li><a href="#uniaxial">uniaxial</a><span>, in §5.1</span>
   <li><a href="#update-latest-reading">Update latest reading</a><span>, in §8.7</span>
   <li><a href="#update-mock-sensor-reading">update mock sensor reading</a><span>, in §9.2.3</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-accelerometer-interface">
   <a href="https://w3c.github.io/accelerometer#accelerometer-interface">https://w3c.github.io/accelerometer#accelerometer-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-accelerometer-interface">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-gravitysensor-interface">
   <a href="https://w3c.github.io/accelerometer#gravitysensor-interface">https://w3c.github.io/accelerometer#gravitysensor-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-gravitysensor-interface">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-linearaccelerationsensor-interface">
   <a href="https://w3c.github.io/accelerometer#linearaccelerationsensor-interface">https://w3c.github.io/accelerometer#linearaccelerationsensor-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-linearaccelerationsensor-interface">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ambient-light-sensor-interface">
   <a href="https://w3c.github.io/ambient-light#ambient-light-sensor-interface">https://w3c.github.io/ambient-light#ambient-light-sensor-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ambient-light-sensor-interface">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event">
   <a href="https://dom.spec.whatwg.org/#event">https://dom.spec.whatwg.org/#event</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event">7.2. The SensorErrorEvent Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dictdef-eventinit">
   <a href="https://dom.spec.whatwg.org/#dictdef-eventinit">https://dom.spec.whatwg.org/#dictdef-eventinit</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-eventinit">7.2. The SensorErrorEvent Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-eventtarget">
   <a href="https://dom.spec.whatwg.org/#eventtarget">https://dom.spec.whatwg.org/#eventtarget</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventtarget">7.1. The Sensor Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-document">
   <a href="https://dom.spec.whatwg.org/#concept-document">https://dom.spec.whatwg.org/#concept-document</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-document">4.2.2. Feature Policy</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-event">
   <a href="https://dom.spec.whatwg.org#concept-event">https://dom.spec.whatwg.org#concept-event</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-event">7.1. The Sensor Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-event-listener">
   <a href="https://dom.spec.whatwg.org#concept-event-listener">https://dom.spec.whatwg.org#concept-event-listener</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-event-listener">7.1. The Sensor Interface</a>
    <li><a href="#ref-for-concept-event-listener①">10.5. When is Enabling Multiple Sensors of the Same Type Not the Right Choice?</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-event-fire">
   <a href="https://dom.spec.whatwg.org/#concept-event-fire">https://dom.spec.whatwg.org/#concept-event-fire</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-event-fire">5.5. Sampling Frequency and Reporting Frequency</a>
    <li><a href="#ref-for-concept-event-fire①">8.11. Notify new reading</a>
    <li><a href="#ref-for-concept-event-fire②">8.12. Notify activated state</a>
    <li><a href="#ref-for-concept-event-fire③">8.13. Notify error</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-iframe-allow-attribute">
   <a href="https://w3c.github.io/webappsec-feature-policy/#iframe-allow-attribute">https://w3c.github.io/webappsec-feature-policy/#iframe-allow-attribute</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-iframe-allow-attribute">10.9. Extending the Feature Policy API</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-should-request-be-allowed-to-use-feature">
   <a href="https://w3c.github.io/webappsec-feature-policy/#should-request-be-allowed-to-use-feature">https://w3c.github.io/webappsec-feature-policy/#should-request-be-allowed-to-use-feature</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-should-request-be-allowed-to-use-feature">4.2.2. Feature Policy</a>
    <li><a href="#ref-for-should-request-be-allowed-to-use-feature①">5.6. Conditions to expose sensor readings</a>
    <li><a href="#ref-for-should-request-be-allowed-to-use-feature②">8.2. Check sensor policy-controlled features</a> <a href="#ref-for-should-request-be-allowed-to-use-feature③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-default-allowlist">
   <a href="https://w3c.github.io/webappsec-feature-policy/#default-allowlist">https://w3c.github.io/webappsec-feature-policy/#default-allowlist</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-default-allowlist">10.9. Extending the Feature Policy API</a> <a href="#ref-for-default-allowlist①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-policy-controlled-feature">
   <a href="https://w3c.github.io/webappsec-feature-policy/#policy-controlled-feature">https://w3c.github.io/webappsec-feature-policy/#policy-controlled-feature</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-policy-controlled-feature">4.2.2. Feature Policy</a>
    <li><a href="#ref-for-policy-controlled-feature①">5.6. Conditions to expose sensor readings</a>
    <li><a href="#ref-for-policy-controlled-feature②">6.1. Sensor Type</a>
    <li><a href="#ref-for-policy-controlled-feature③">8.2. Check sensor policy-controlled features</a>
    <li><a href="#ref-for-policy-controlled-feature④">10.9. Extending the Feature Policy API</a> <a href="#ref-for-policy-controlled-feature⑤">(2)</a> <a href="#ref-for-policy-controlled-feature⑥">(3)</a> <a href="#ref-for-policy-controlled-feature⑦">(4)</a> <a href="#ref-for-policy-controlled-feature⑧">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-geolocationsensor-interface">
   <a href="https://w3c.github.io/geolocation-sensor/#geolocationsensor-interface">https://w3c.github.io/geolocation-sensor/#geolocationsensor-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-geolocationsensor-interface">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-gyroscope-interface">
   <a href="https://w3c.github.io/gyroscope#gyroscope-interface">https://w3c.github.io/gyroscope#gyroscope-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-gyroscope-interface">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-domhighrestimestamp">
   <a href="https://www.w3.org/TR/hr-time-2/#dom-domhighrestimestamp">https://www.w3.org/TR/hr-time-2/#dom-domhighrestimestamp</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-domhighrestimestamp">7.1. The Sensor Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-time-origin">
   <a href="https://www.w3.org/TR/hr-time-2/#dfn-time-origin">https://www.w3.org/TR/hr-time-2/#dfn-time-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-time-origin">6.2. Sensor</a>
    <li><a href="#ref-for-dfn-time-origin①">7.1.3. Sensor internal slots</a>
    <li><a href="#ref-for-dfn-time-origin②">9.1. Mock Sensors</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-eventhandler">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler">https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventhandler">7.1. The Sensor Interface</a> <a href="#ref-for-eventhandler①">(2)</a> <a href="#ref-for-eventhandler②">(3)</a>
    <li><a href="#ref-for-eventhandler③">7.1.9. Sensor.onreading</a>
    <li><a href="#ref-for-eventhandler④">7.1.10. Sensor.onactivate</a>
    <li><a href="#ref-for-eventhandler⑤">7.1.11. Sensor.onerror</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-active-document">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">https://html.spec.whatwg.org/multipage/browsers.html#active-document</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-active-document">4.2.3. Focused Area</a>
    <li><a href="#ref-for-active-document①">4.2.4. Visibility State</a>
    <li><a href="#ref-for-active-document②">5.6. Conditions to expose sensor readings</a> <a href="#ref-for-active-document③">(2)</a>
    <li><a href="#ref-for-active-document④">6.2. Sensor</a> <a href="#ref-for-active-document⑤">(2)</a>
    <li><a href="#ref-for-active-document⑥">8.2. Check sensor policy-controlled features</a>
    <li><a href="#ref-for-active-document⑦">9.1. Mock Sensors</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-browsing-context">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context">https://html.spec.whatwg.org/multipage/browsers.html#browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-browsing-context">4.2.3. Focused Area</a>
    <li><a href="#ref-for-browsing-context①">6.2. Sensor</a> <a href="#ref-for-browsing-context②">(2)</a> <a href="#ref-for-browsing-context③">(3)</a> <a href="#ref-for-browsing-context④">(4)</a> <a href="#ref-for-browsing-context⑤">(5)</a> <a href="#ref-for-browsing-context⑥">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-currently-focused-area-of-a-top-level-browsing-context">
   <a href="https://html.spec.whatwg.org/multipage/interaction.html#currently-focused-area-of-a-top-level-browsing-context">https://html.spec.whatwg.org/multipage/interaction.html#currently-focused-area-of-a-top-level-browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-currently-focused-area-of-a-top-level-browsing-context">4.2.3. Focused Area</a>
    <li><a href="#ref-for-currently-focused-area-of-a-top-level-browsing-context①">5.6. Conditions to expose sensor readings</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-handlers">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers">https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-handlers">7.1. The Sensor Interface</a>
    <li><a href="#ref-for-event-handlers①">7.1.12. Event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-handler-event-type">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type">https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-handler-event-type">7.1. The Sensor Interface</a>
    <li><a href="#ref-for-event-handler-event-type①">7.1.12. Event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-gains-focus">
   <a href="https://html.spec.whatwg.org/multipage/interaction.html#gains-focus">https://html.spec.whatwg.org/multipage/interaction.html#gains-focus</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-gains-focus">4.2.3. Focused Area</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-in-parallel">
   <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-in-parallel">7.1.7. Sensor.start()</a>
    <li><a href="#ref-for-in-parallel①">7.1.8. Sensor.stop()</a>
    <li><a href="#ref-for-in-parallel②">8.8. Update latest reading</a>
    <li><a href="#ref-for-in-parallel③">8.15. Request sensor access</a>
    <li><a href="#ref-for-in-parallel④">9.2.1. Create mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-origin-2">
   <a href="https://html.spec.whatwg.org/multipage/origin.html#origin-2">https://html.spec.whatwg.org/multipage/origin.html#origin-2</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-origin-2">6.2. Sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-responsible-document">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-document">https://html.spec.whatwg.org/multipage/webappapis.html#responsible-document</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-responsible-document">5.6. Conditions to expose sensor readings</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-same-origin-domain">
   <a href="https://html.spec.whatwg.org/multipage/origin.html#same-origin-domain">https://html.spec.whatwg.org/multipage/origin.html#same-origin-domain</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-same-origin-domain">4.2.3. Focused Area</a>
    <li><a href="#ref-for-same-origin-domain①">5.6. Conditions to expose sensor readings</a>
    <li><a href="#ref-for-same-origin-domain②">6.2. Sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-spin-the-event-loop">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#spin-the-event-loop">https://html.spec.whatwg.org/multipage/webappapis.html#spin-the-event-loop</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-spin-the-event-loop">8.10. Report latest reading updated</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-task">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task">https://html.spec.whatwg.org/multipage/webappapis.html#concept-task</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-task">7.1. The Sensor Interface</a>
    <li><a href="#ref-for-concept-task①">8.5. Deactivate a sensor object</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-task-queue">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#task-queue">https://html.spec.whatwg.org/multipage/webappapis.html#task-queue</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-task-queue">8.5. Deactivate a sensor object</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-task-source">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source">https://html.spec.whatwg.org/multipage/webappapis.html#task-source</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-task-source">7.1. The Sensor Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-set-append">
   <a href="https://infra.spec.whatwg.org/#set-append">https://infra.spec.whatwg.org/#set-append</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-set-append">8.4. Activate a sensor object</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-contain">
   <a href="https://infra.spec.whatwg.org/#list-contain">https://infra.spec.whatwg.org/#list-contain</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-contain">6.1. Sensor Type</a>
    <li><a href="#ref-for-list-contain①">8.1. Initialize a sensor object</a>
    <li><a href="#ref-for-list-contain②">8.5. Deactivate a sensor object</a>
    <li><a href="#ref-for-list-contain③">9.2.4. Delete mock sensor</a>
    <li><a href="#ref-for-list-contain④">10.6. Definition Requirements</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-map-entry">
   <a href="https://infra.spec.whatwg.org/#map-entry">https://infra.spec.whatwg.org/#map-entry</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-map-entry">6.2. Sensor</a> <a href="#ref-for-map-entry①">(2)</a> <a href="#ref-for-map-entry②">(3)</a> <a href="#ref-for-map-entry③">(4)</a>
    <li><a href="#ref-for-map-entry④">9.1. Mock Sensors</a> <a href="#ref-for-map-entry⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-map-iterate">
   <a href="https://infra.spec.whatwg.org/#map-iterate">https://infra.spec.whatwg.org/#map-iterate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-map-iterate">8.1. Initialize a sensor object</a>
    <li><a href="#ref-for-map-iterate①">8.7. Set sensor settings</a>
    <li><a href="#ref-for-map-iterate②">8.8. Update latest reading</a>
    <li><a href="#ref-for-map-iterate③">9.2.3. Update mock sensor reading</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-is-empty">
   <a href="https://infra.spec.whatwg.org/#list-is-empty">https://infra.spec.whatwg.org/#list-is-empty</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-is-empty">6.1. Sensor Type</a> <a href="#ref-for-list-is-empty①">(2)</a>
    <li><a href="#ref-for-list-is-empty②">6.2. Sensor</a> <a href="#ref-for-list-is-empty③">(2)</a>
    <li><a href="#ref-for-list-is-empty④">8.7. Set sensor settings</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-map-key">
   <a href="https://infra.spec.whatwg.org/#map-key">https://infra.spec.whatwg.org/#map-key</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-map-key">6.2. Sensor</a> <a href="#ref-for-map-key①">(2)</a>
    <li><a href="#ref-for-map-key②">9.1. Mock Sensors</a> <a href="#ref-for-map-key③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ordered-map">
   <a href="https://infra.spec.whatwg.org/#ordered-map">https://infra.spec.whatwg.org/#ordered-map</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ordered-map">6.2. Sensor</a> <a href="#ref-for-ordered-map①">(2)</a> <a href="#ref-for-ordered-map②">(3)</a> <a href="#ref-for-ordered-map③">(4)</a> <a href="#ref-for-ordered-map④">(5)</a> <a href="#ref-for-ordered-map⑤">(6)</a>
    <li><a href="#ref-for-ordered-map⑥">9.1. Mock Sensors</a> <a href="#ref-for-ordered-map⑦">(2)</a> <a href="#ref-for-ordered-map⑧">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ordered-set">
   <a href="https://infra.spec.whatwg.org/#ordered-set">https://infra.spec.whatwg.org/#ordered-set</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ordered-set">5.6. Conditions to expose sensor readings</a>
    <li><a href="#ref-for-ordered-set①">6.1. Sensor Type</a> <a href="#ref-for-ordered-set②">(2)</a> <a href="#ref-for-ordered-set③">(3)</a> <a href="#ref-for-ordered-set④">(4)</a>
    <li><a href="#ref-for-ordered-set⑤">6.2. Sensor</a> <a href="#ref-for-ordered-set⑥">(2)</a> <a href="#ref-for-ordered-set⑦">(3)</a>
    <li><a href="#ref-for-ordered-set⑧">8.6. Revoke sensor permission</a>
    <li><a href="#ref-for-ordered-set⑨">8.8. Update latest reading</a>
    <li><a href="#ref-for-ordered-set①⓪">8.15. Request sensor access</a>
    <li><a href="#ref-for-ordered-set①①">10.6. Definition Requirements</a>
    <li><a href="#ref-for-ordered-set①②">10.9. Extending the Feature Policy API</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-remove">
   <a href="https://infra.spec.whatwg.org/#list-remove">https://infra.spec.whatwg.org/#list-remove</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-remove">8.5. Deactivate a sensor object</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-map-set">
   <a href="https://infra.spec.whatwg.org/#map-set">https://infra.spec.whatwg.org/#map-set</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-map-set">8.7. Set sensor settings</a>
    <li><a href="#ref-for-map-set①">8.8. Update latest reading</a>
    <li><a href="#ref-for-map-set②">9.2.3. Update mock sensor reading</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-map-value">
   <a href="https://infra.spec.whatwg.org/#map-value">https://infra.spec.whatwg.org/#map-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-map-value">6.2. Sensor</a> <a href="#ref-for-map-value①">(2)</a>
    <li><a href="#ref-for-map-value②">9.1. Mock Sensors</a> <a href="#ref-for-map-value③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-magnetometer-interface">
   <a href="https://w3c.github.io/magnetometer#magnetometer-interface">https://w3c.github.io/magnetometer#magnetometer-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-magnetometer-interface">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-uncalibrated-magnetometer-interface">
   <a href="https://w3c.github.io/magnetometer#uncalibrated-magnetometer-interface">https://w3c.github.io/magnetometer#uncalibrated-magnetometer-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-uncalibrated-magnetometer-interface">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-absoluteorientationsensor-interface">
   <a href="https://w3c.github.io/orientation-sensor#absoluteorientationsensor-interface">https://w3c.github.io/orientation-sensor#absoluteorientationsensor-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-absoluteorientationsensor-interface">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-relativeorientationsensor-interface">
   <a href="https://w3c.github.io/orientation-sensor#relativeorientationsensor-interface">https://w3c.github.io/orientation-sensor#relativeorientationsensor-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-relativeorientationsensor-interface">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-visibilitystate">
   <a href="https://www.w3.org/TR/page-visibility-2/#dom-visibilitystate">https://www.w3.org/TR/page-visibility-2/#dom-visibilitystate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-visibilitystate">5.6. Conditions to expose sensor readings</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-steps-to-determine-the-visibility-state">
   <a href="https://www.w3.org/TR/page-visibility-2/#dfn-steps-to-determine-the-visibility-state">https://www.w3.org/TR/page-visibility-2/#dfn-steps-to-determine-the-visibility-state</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-steps-to-determine-the-visibility-state">4.2.4. Visibility State</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dictdef-permissiondescriptor">
   <a href="https://w3c.github.io/permissions/#dictdef-permissiondescriptor">https://w3c.github.io/permissions/#dictdef-permissiondescriptor</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-permissiondescriptor">10.8. Extending the Permission API</a> <a href="#ref-for-dictdef-permissiondescriptor①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-enumdef-permissionname">
   <a href="https://w3c.github.io/permissions/#enumdef-permissionname">https://w3c.github.io/permissions/#enumdef-permissionname</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-permissionname③">6.1. Sensor Type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-enumdef-permissionname">
   <a href="https://www.w3.org/TR/permissions/#enumdef-permissionname">https://www.w3.org/TR/permissions/#enumdef-permissionname</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-permissionname">5.6. Conditions to expose sensor readings</a>
    <li><a href="#ref-for-enumdef-permissionname①">6.1. Sensor Type</a> <a href="#ref-for-enumdef-permissionname②">(2)</a>
    <li><a href="#ref-for-enumdef-permissionname④">10.6. Definition Requirements</a> <a href="#ref-for-enumdef-permissionname⑤">(2)</a>
    <li><a href="#ref-for-enumdef-permissionname⑥">10.8. Extending the Permission API</a> <a href="#ref-for-enumdef-permissionname⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-permission-revocation-algorithm">
   <a href="https://w3c.github.io/permissions/#permission-revocation-algorithm">https://w3c.github.io/permissions/#permission-revocation-algorithm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-revocation-algorithm">6.1. Sensor Type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-permission-state">
   <a href="https://www.w3.org/TR/permissions/#permission-state">https://www.w3.org/TR/permissions/#permission-state</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-state">5.6. Conditions to expose sensor readings</a>
    <li><a href="#ref-for-permission-state①">8.15. Request sensor access</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-request-permission-to-use">
   <a href="https://w3c.github.io/permissions/#request-permission-to-use">https://w3c.github.io/permissions/#request-permission-to-use</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-request-permission-to-use">8.15. Request sensor access</a>
    <li><a href="#ref-for-request-permission-to-use①">10.8. Extending the Permission API</a> <a href="#ref-for-request-permission-to-use②">(2)</a> <a href="#ref-for-request-permission-to-use③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-permission-request-algorithm">
   <a href="https://wicg.github.io/permissions-request/#permission-request-algorithm">https://wicg.github.io/permissions-request/#permission-request-algorithm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-request-algorithm①">6.1. Sensor Type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-secure-contexts">
   <a href="https://w3c.github.io/webappsec-secure-contexts/#secure-contexts">https://w3c.github.io/webappsec-secure-contexts/#secure-contexts</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-secure-contexts">4.2.1. Secure Context</a>
    <li><a href="#ref-for-secure-contexts①">5.6. Conditions to expose sensor readings</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-proximity-sensor-interface">
   <a href="https://w3c.github.io/proximity#proximity-sensor-interface">https://w3c.github.io/proximity#proximity-sensor-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-proximity-sensor-interface">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sop-violations">
   <a href="https://w3ctag.github.io/security-questionnaire/#sop-violations">https://w3ctag.github.io/security-questionnaire/#sop-violations</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sop-violations">10.1. Security and Privacy</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-current-browsing-context">
   <a href="https://w3c.github.io/webdriver/#dfn-current-browsing-context">https://w3c.github.io/webdriver/#dfn-current-browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-current-browsing-context">9.1. Mock Sensors</a> <a href="#ref-for-dfn-current-browsing-context①">(2)</a>
    <li><a href="#ref-for-dfn-current-browsing-context②">9.1.2. MockSensor dictionary</a>
    <li><a href="#ref-for-dfn-current-browsing-context③">9.2.1. Create mock sensor</a> <a href="#ref-for-dfn-current-browsing-context④">(2)</a> <a href="#ref-for-dfn-current-browsing-context⑤">(3)</a> <a href="#ref-for-dfn-current-browsing-context⑥">(4)</a> <a href="#ref-for-dfn-current-browsing-context⑦">(5)</a>
    <li><a href="#ref-for-dfn-current-browsing-context⑧">9.2.2. Get mock sensor</a> <a href="#ref-for-dfn-current-browsing-context⑨">(2)</a>
    <li><a href="#ref-for-dfn-current-browsing-context①⓪">9.2.3. Update mock sensor reading</a> <a href="#ref-for-dfn-current-browsing-context①①">(2)</a>
    <li><a href="#ref-for-dfn-current-browsing-context①②">9.2.4. Delete mock sensor</a> <a href="#ref-for-dfn-current-browsing-context①③">(2)</a> <a href="#ref-for-dfn-current-browsing-context①④">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-extension-command-uri-template">
   <a href="https://w3c.github.io/webdriver/#dfn-extension-command-uri-template">https://w3c.github.io/webdriver/#dfn-extension-command-uri-template</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-extension-command-uri-template">9.2.1. Create mock sensor</a>
    <li><a href="#ref-for-dfn-extension-command-uri-template①">9.2.2. Get mock sensor</a>
    <li><a href="#ref-for-dfn-extension-command-uri-template②">9.2.3. Update mock sensor reading</a>
    <li><a href="#ref-for-dfn-extension-command-uri-template③">9.2.4. Delete mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-extension-command">
   <a href="https://w3c.github.io/webdriver/#dfn-extension-command">https://w3c.github.io/webdriver/#dfn-extension-command</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-extension-command">9. Automation</a> <a href="#ref-for-dfn-extension-command①">(2)</a>
    <li><a href="#ref-for-dfn-extension-command②">9.2.1. Create mock sensor</a>
    <li><a href="#ref-for-dfn-extension-command③">9.2.2. Get mock sensor</a>
    <li><a href="#ref-for-dfn-extension-command④">9.2.3. Update mock sensor reading</a>
    <li><a href="#ref-for-dfn-extension-command⑤">9.2.4. Delete mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-handle-any-user-prompts">
   <a href="https://w3c.github.io/webdriver/#dfn-handle-any-user-prompts">https://w3c.github.io/webdriver/#dfn-handle-any-user-prompts</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-handle-any-user-prompts">9.2.1. Create mock sensor</a>
    <li><a href="#ref-for-dfn-handle-any-user-prompts①">9.2.2. Get mock sensor</a>
    <li><a href="#ref-for-dfn-handle-any-user-prompts②">9.2.3. Update mock sensor reading</a>
    <li><a href="#ref-for-dfn-handle-any-user-prompts③">9.2.4. Delete mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-handling-errors">
   <a href="https://w3c.github.io/webdriver/#handling-errors">https://w3c.github.io/webdriver/#handling-errors</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-handling-errors">9.3. Handling errors</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-invalid-argument">
   <a href="https://w3c.github.io/webdriver/#dfn-invalid-argument">https://w3c.github.io/webdriver/#dfn-invalid-argument</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-invalid-argument">9.2.1. Create mock sensor</a>
    <li><a href="#ref-for-dfn-invalid-argument①">9.2.2. Get mock sensor</a>
    <li><a href="#ref-for-dfn-invalid-argument②">9.2.3. Update mock sensor reading</a> <a href="#ref-for-dfn-invalid-argument③">(2)</a>
    <li><a href="#ref-for-dfn-invalid-argument④">9.2.4. Delete mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-local-end">
   <a href="https://w3c.github.io/webdriver/#dfn-local-end">https://w3c.github.io/webdriver/#dfn-local-end</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-local-end">9.2.1. Create mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-no-longer-open">
   <a href="https://w3c.github.io/webdriver/#dfn-no-longer-open">https://w3c.github.io/webdriver/#dfn-no-longer-open</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-no-longer-open">9.2.1. Create mock sensor</a>
    <li><a href="#ref-for-dfn-no-longer-open①">9.2.2. Get mock sensor</a>
    <li><a href="#ref-for-dfn-no-longer-open②">9.2.3. Update mock sensor reading</a>
    <li><a href="#ref-for-dfn-no-longer-open③">9.2.4. Delete mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-no-such-window">
   <a href="https://w3c.github.io/webdriver/#dfn-no-such-window">https://w3c.github.io/webdriver/#dfn-no-such-window</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-no-such-window">9.2.1. Create mock sensor</a>
    <li><a href="#ref-for-dfn-no-such-window①">9.2.2. Get mock sensor</a>
    <li><a href="#ref-for-dfn-no-such-window②">9.2.3. Update mock sensor reading</a>
    <li><a href="#ref-for-dfn-no-such-window③">9.2.4. Delete mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-object">
   <a href="https://w3c.github.io/webdriver/#dfn-object">https://w3c.github.io/webdriver/#dfn-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-object">9.1.2. MockSensor dictionary</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-remote-end-steps">
   <a href="https://w3c.github.io/webdriver/#dfn-remote-end-steps">https://w3c.github.io/webdriver/#dfn-remote-end-steps</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-remote-end-steps">9.2.1. Create mock sensor</a>
    <li><a href="#ref-for-dfn-remote-end-steps①">9.2.2. Get mock sensor</a>
    <li><a href="#ref-for-dfn-remote-end-steps②">9.2.3. Update mock sensor reading</a>
    <li><a href="#ref-for-dfn-remote-end-steps③">9.2.4. Delete mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-session">
   <a href="https://w3c.github.io/webdriver/#dfn-session">https://w3c.github.io/webdriver/#dfn-session</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-session">9.2.1. Create mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-success">
   <a href="https://w3c.github.io/webdriver/#dfn-success">https://w3c.github.io/webdriver/#dfn-success</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-success">9.2.1. Create mock sensor</a>
    <li><a href="#ref-for-dfn-success①">9.2.2. Get mock sensor</a>
    <li><a href="#ref-for-dfn-success②">9.2.3. Update mock sensor reading</a>
    <li><a href="#ref-for-dfn-success③">9.2.4. Delete mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-url-variables">
   <a href="https://w3c.github.io/webdriver/#dfn-url-variables">https://w3c.github.io/webdriver/#dfn-url-variables</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-url-variables">9.2.2. Get mock sensor</a>
    <li><a href="#ref-for-dfn-url-variables①">9.2.3. Update mock sensor reading</a>
    <li><a href="#ref-for-dfn-url-variables②">9.2.4. Delete mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-errors">
   <a href="https://w3c.github.io/webdriver/#dfn-errors">https://w3c.github.io/webdriver/#dfn-errors</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-errors">9.2.1. Create mock sensor</a> <a href="#ref-for-dfn-errors①">(2)</a> <a href="#ref-for-dfn-errors②">(3)</a> <a href="#ref-for-dfn-errors③">(4)</a> <a href="#ref-for-dfn-errors④">(5)</a>
    <li><a href="#ref-for-dfn-errors⑤">9.2.2. Get mock sensor</a> <a href="#ref-for-dfn-errors⑥">(2)</a> <a href="#ref-for-dfn-errors⑦">(3)</a> <a href="#ref-for-dfn-errors⑧">(4)</a>
    <li><a href="#ref-for-dfn-errors⑨">9.2.3. Update mock sensor reading</a> <a href="#ref-for-dfn-errors①⓪">(2)</a> <a href="#ref-for-dfn-errors①①">(3)</a> <a href="#ref-for-dfn-errors①②">(4)</a> <a href="#ref-for-dfn-errors①③">(5)</a>
    <li><a href="#ref-for-dfn-errors①④">9.2.4. Delete mock sensor</a> <a href="#ref-for-dfn-errors①⑤">(2)</a> <a href="#ref-for-dfn-errors①⑥">(3)</a> <a href="#ref-for-dfn-errors①⑦">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-error-code">
   <a href="https://w3c.github.io/webdriver/#dfn-error-code">https://w3c.github.io/webdriver/#dfn-error-code</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-error-code">9.2.1. Create mock sensor</a> <a href="#ref-for-dfn-error-code①">(2)</a> <a href="#ref-for-dfn-error-code②">(3)</a> <a href="#ref-for-dfn-error-code③">(4)</a>
    <li><a href="#ref-for-dfn-error-code④">9.2.2. Get mock sensor</a> <a href="#ref-for-dfn-error-code⑤">(2)</a> <a href="#ref-for-dfn-error-code⑥">(3)</a>
    <li><a href="#ref-for-dfn-error-code⑦">9.2.3. Update mock sensor reading</a> <a href="#ref-for-dfn-error-code⑧">(2)</a> <a href="#ref-for-dfn-error-code⑨">(3)</a> <a href="#ref-for-dfn-error-code①⓪">(4)</a>
    <li><a href="#ref-for-dfn-error-code①①">9.2.4. Delete mock sensor</a> <a href="#ref-for-dfn-error-code①②">(2)</a> <a href="#ref-for-dfn-error-code①③">(3)</a>
    <li><a href="#ref-for-dfn-error-code①④">9.3. Handling errors</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-Constructor">
   <a href="https://heycam.github.io/webidl/#Constructor">https://heycam.github.io/webidl/#Constructor</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-Constructor">10.6. Definition Requirements</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-DOMException">
   <a href="https://heycam.github.io/webidl/#idl-DOMException">https://heycam.github.io/webidl/#idl-DOMException</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-DOMException">7.1.7. Sensor.start()</a> <a href="#ref-for-idl-DOMException①">(2)</a>
    <li><a href="#ref-for-idl-DOMException②">7.2. The SensorErrorEvent Interface</a> <a href="#ref-for-idl-DOMException③">(2)</a>
    <li><a href="#ref-for-idl-DOMException④">7.2.1. SensorErrorEvent.error</a>
    <li><a href="#ref-for-idl-DOMException⑤">8.1. Initialize a sensor object</a>
    <li><a href="#ref-for-idl-DOMException⑥">8.6. Revoke sensor permission</a>
    <li><a href="#ref-for-idl-DOMException⑦">8.13. Notify error</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-DOMString">
   <a href="https://heycam.github.io/webidl/#idl-DOMString">https://heycam.github.io/webidl/#idl-DOMString</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-DOMString">7.2. The SensorErrorEvent Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-Exposed">
   <a href="https://heycam.github.io/webidl/#Exposed">https://heycam.github.io/webidl/#Exposed</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-Exposed">7.1. The Sensor Interface</a>
    <li><a href="#ref-for-Exposed①">7.2. The SensorErrorEvent Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-notallowederror">
   <a href="https://heycam.github.io/webidl/#notallowederror">https://heycam.github.io/webidl/#notallowederror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-notallowederror">7.1.7. Sensor.start()</a>
    <li><a href="#ref-for-notallowederror①">8.6. Revoke sensor permission</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-notreadableerror">
   <a href="https://heycam.github.io/webidl/#notreadableerror">https://heycam.github.io/webidl/#notreadableerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-notreadableerror">7.1.7. Sensor.start()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-notsupportederror">
   <a href="https://heycam.github.io/webidl/#notsupportederror">https://heycam.github.io/webidl/#notsupportederror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-notsupportederror">8.1. Initialize a sensor object</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-SecureContext">
   <a href="https://heycam.github.io/webidl/#SecureContext">https://heycam.github.io/webidl/#SecureContext</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-SecureContext">7.1. The Sensor Interface</a>
    <li><a href="#ref-for-SecureContext①">7.2. The SensorErrorEvent Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-attribute">
   <a href="https://heycam.github.io/webidl/#dfn-attribute">https://heycam.github.io/webidl/#dfn-attribute</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-attribute">6.2. Sensor</a> <a href="#ref-for-dfn-attribute①">(2)</a> <a href="#ref-for-dfn-attribute②">(3)</a>
    <li><a href="#ref-for-dfn-attribute③">9.1.3. Mock sensor type</a>
    <li><a href="#ref-for-dfn-attribute④">10.6. Definition Requirements</a> <a href="#ref-for-dfn-attribute⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-boolean">
   <a href="https://heycam.github.io/webidl/#idl-boolean">https://heycam.github.io/webidl/#idl-boolean</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-boolean">7.1. The Sensor Interface</a> <a href="#ref-for-idl-boolean①">(2)</a>
    <li><a href="#ref-for-idl-boolean②">9.1.1. MockSensorConfiguration dictionary</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-convert-ecmascript-to-idl-value">
   <a href="https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value">https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-convert-ecmascript-to-idl-value">9.2.1. Create mock sensor</a>
    <li><a href="#ref-for-dfn-convert-ecmascript-to-idl-value①">9.2.2. Get mock sensor</a>
    <li><a href="#ref-for-dfn-convert-ecmascript-to-idl-value②">9.2.3. Update mock sensor reading</a> <a href="#ref-for-dfn-convert-ecmascript-to-idl-value③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-create-exception">
   <a href="https://heycam.github.io/webidl/#dfn-create-exception">https://heycam.github.io/webidl/#dfn-create-exception</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-create-exception">7.1.7. Sensor.start()</a> <a href="#ref-for-dfn-create-exception①">(2)</a>
    <li><a href="#ref-for-dfn-create-exception②">8.6. Revoke sensor permission</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-dictionary">
   <a href="https://heycam.github.io/webidl/#dfn-dictionary">https://heycam.github.io/webidl/#dfn-dictionary</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-dictionary">8.1. Initialize a sensor object</a>
    <li><a href="#ref-for-dfn-dictionary①">10.6. Definition Requirements</a> <a href="#ref-for-dfn-dictionary②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-dictionary-member">
   <a href="https://heycam.github.io/webidl/#dfn-dictionary-member">https://heycam.github.io/webidl/#dfn-dictionary-member</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-dictionary-member">9.1. Mock Sensors</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-double">
   <a href="https://heycam.github.io/webidl/#idl-double">https://heycam.github.io/webidl/#idl-double</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-double">7.1. The Sensor Interface</a>
    <li><a href="#ref-for-idl-double①">9.1.1. MockSensorConfiguration dictionary</a> <a href="#ref-for-idl-double②">(2)</a>
    <li><a href="#ref-for-idl-double③">9.1.2. MockSensor dictionary</a> <a href="#ref-for-idl-double④">(2)</a> <a href="#ref-for-idl-double⑤">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-identifier">
   <a href="https://heycam.github.io/webidl/#dfn-identifier">https://heycam.github.io/webidl/#dfn-identifier</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-identifier">6.2. Sensor</a> <a href="#ref-for-dfn-identifier①">(2)</a>
    <li><a href="#ref-for-dfn-identifier②">9.1. Mock Sensors</a>
    <li><a href="#ref-for-dfn-identifier③">9.1.3. Mock sensor type</a>
    <li><a href="#ref-for-dfn-identifier④">10.6. Definition Requirements</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-inherited-dictionaries">
   <a href="https://heycam.github.io/webidl/#dfn-inherited-dictionaries">https://heycam.github.io/webidl/#dfn-inherited-dictionaries</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-inherited-dictionaries">10.6. Definition Requirements</a> <a href="#ref-for-dfn-inherited-dictionaries①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-inherited-interfaces">
   <a href="https://heycam.github.io/webidl/#dfn-inherited-interfaces">https://heycam.github.io/webidl/#dfn-inherited-interfaces</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-inherited-interfaces">10.6. Definition Requirements</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-interface">
   <a href="https://heycam.github.io/webidl/#dfn-interface">https://heycam.github.io/webidl/#dfn-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-interface">10.6. Definition Requirements</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-present">
   <a href="https://heycam.github.io/webidl/#dfn-present">https://heycam.github.io/webidl/#dfn-present</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-present">8.1. Initialize a sensor object</a>
    <li><a href="#ref-for-dfn-present①">9.2.1. Create mock sensor</a> <a href="#ref-for-dfn-present②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-read-only">
   <a href="https://heycam.github.io/webidl/#dfn-read-only">https://heycam.github.io/webidl/#dfn-read-only</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-read-only">10.6. Definition Requirements</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-throw">
   <a href="https://heycam.github.io/webidl/#dfn-throw">https://heycam.github.io/webidl/#dfn-throw</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-throw">8.1. Initialize a sensor object</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[accelerometer]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-accelerometer-interface" style="color:initial">accelerometer</span>
     <li><span class="dfn-paneled" id="term-for-gravitysensor-interface" style="color:initial">gravitysensor</span>
     <li><span class="dfn-paneled" id="term-for-linearaccelerationsensor-interface" style="color:initial">linearaccelerationsensor</span>
    </ul>
   <li>
    <a data-link-type="biblio">[ambient-light]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-ambient-light-sensor-interface" style="color:initial">ambientlightsensor</span>
    </ul>
   <li>
    <a data-link-type="biblio">[DOM]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-event" style="color:initial">Event</span>
     <li><span class="dfn-paneled" id="term-for-dictdef-eventinit" style="color:initial">EventInit</span>
     <li><span class="dfn-paneled" id="term-for-eventtarget" style="color:initial">EventTarget</span>
     <li><span class="dfn-paneled" id="term-for-concept-document" style="color:initial">document</span>
     <li><span class="dfn-paneled" id="term-for-concept-event" style="color:initial">event</span>
     <li><span class="dfn-paneled" id="term-for-concept-event-listener" style="color:initial">event listener</span>
     <li><span class="dfn-paneled" id="term-for-concept-event-fire" style="color:initial">fire an event</span>
    </ul>
   <li>
    <a data-link-type="biblio">[FEATURE-POLICY]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-iframe-allow-attribute" style="color:initial">allow attribute</span>
     <li><span class="dfn-paneled" id="term-for-should-request-be-allowed-to-use-feature" style="color:initial">allowed to use</span>
     <li><span class="dfn-paneled" id="term-for-default-allowlist" style="color:initial">default allowlist</span>
     <li><span class="dfn-paneled" id="term-for-policy-controlled-feature" style="color:initial">policy-controlled feature</span>
    </ul>
   <li>
    <a data-link-type="biblio">[geolocation-sensor]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-geolocationsensor-interface" style="color:initial">geolocationsensor</span>
    </ul>
   <li>
    <a data-link-type="biblio">[gyroscope]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-gyroscope-interface" style="color:initial">gyroscope</span>
    </ul>
   <li>
    <a data-link-type="biblio">[hr-time-2]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dom-domhighrestimestamp" style="color:initial">DOMHighResTimeStamp</span>
     <li><span class="dfn-paneled" id="term-for-dfn-time-origin" style="color:initial">time origin</span>
    </ul>
   <li>
    <a data-link-type="biblio">[HTML]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-eventhandler" style="color:initial">EventHandler</span>
     <li><span class="dfn-paneled" id="term-for-active-document" style="color:initial">active document</span>
     <li><span class="dfn-paneled" id="term-for-browsing-context" style="color:initial">browsing context</span>
     <li><span class="dfn-paneled" id="term-for-currently-focused-area-of-a-top-level-browsing-context" style="color:initial">currently focused area</span>
     <li><span class="dfn-paneled" id="term-for-event-handlers" style="color:initial">event handler</span>
     <li><span class="dfn-paneled" id="term-for-event-handler-event-type" style="color:initial">event handler event type</span>
     <li><span class="dfn-paneled" id="term-for-gains-focus" style="color:initial">gains focus</span>
     <li><span class="dfn-paneled" id="term-for-in-parallel" style="color:initial">in parallel</span>
     <li><span class="dfn-paneled" id="term-for-origin-2" style="color:initial">origin</span>
     <li><span class="dfn-paneled" id="term-for-responsible-document" style="color:initial">responsible document</span>
     <li><span class="dfn-paneled" id="term-for-same-origin-domain" style="color:initial">same origin-domain</span>
     <li><span class="dfn-paneled" id="term-for-spin-the-event-loop" style="color:initial">spin the event loop</span>
     <li><span class="dfn-paneled" id="term-for-concept-task" style="color:initial">task</span>
     <li><span class="dfn-paneled" id="term-for-task-queue" style="color:initial">task queue</span>
     <li><span class="dfn-paneled" id="term-for-task-source" style="color:initial">task source</span>
    </ul>
   <li>
    <a data-link-type="biblio">[INFRA]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-set-append" style="color:initial">append</span>
     <li><span class="dfn-paneled" id="term-for-list-contain" style="color:initial">contain</span>
     <li><span class="dfn-paneled" id="term-for-map-entry" style="color:initial">entry</span>
     <li><span class="dfn-paneled" id="term-for-map-iterate" style="color:initial">for each <small>(for map)</small></span>
     <li><span class="dfn-paneled" id="term-for-list-is-empty" style="color:initial">is empty</span>
     <li><span class="dfn-paneled" id="term-for-map-key" style="color:initial">key</span>
     <li><span class="dfn-paneled" id="term-for-ordered-map" style="color:initial">ordered map</span>
     <li><span class="dfn-paneled" id="term-for-ordered-set" style="color:initial">ordered set</span>
     <li><span class="dfn-paneled" id="term-for-list-remove" style="color:initial">remove</span>
     <li><span class="dfn-paneled" id="term-for-map-set" style="color:initial">set</span>
     <li><span class="dfn-paneled" id="term-for-map-value" style="color:initial">value</span>
    </ul>
   <li>
    <a data-link-type="biblio">[magnetometer]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-magnetometer-interface" style="color:initial">magnetometer</span>
     <li><span class="dfn-paneled" id="term-for-uncalibrated-magnetometer-interface" style="color:initial">uncalibratedmagnetometer</span>
    </ul>
   <li>
    <a data-link-type="biblio">[orientation-sensor]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-absoluteorientationsensor-interface" style="color:initial">absoluteorientationsensor</span>
     <li><span class="dfn-paneled" id="term-for-relativeorientationsensor-interface" style="color:initial">relativeorientationsensor</span>
    </ul>
   <li>
    <a data-link-type="biblio">[page-visibility]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dom-visibilitystate" style="color:initial">document visibility state</span>
     <li><span class="dfn-paneled" id="term-for-dfn-steps-to-determine-the-visibility-state" style="color:initial">steps to determine the visibility state</span>
    </ul>
   <li>
    <a data-link-type="biblio">[PERMISSIONS]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dictdef-permissiondescriptor" style="color:initial">PermissionDescriptor</span>
     <li><span class="dfn-paneled" id="term-for-enumdef-permissionname" style="color:initial">PermissionName</span>
     <li><span class="dfn-paneled" id="term-for-enumdef-permissionname①" style="color:initial">permission name</span>
     <li><span class="dfn-paneled" id="term-for-permission-revocation-algorithm" style="color:initial">permission revocation algorithm</span>
     <li><span class="dfn-paneled" id="term-for-permission-state" style="color:initial">permission state</span>
     <li><span class="dfn-paneled" id="term-for-request-permission-to-use" style="color:initial">request permission to use</span>
    </ul>
   <li>
    <a data-link-type="biblio">[PERMISSIONS-REQUEST]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-permission-request-algorithm" style="color:initial">permission request algorithm</span>
    </ul>
   <li>
    <a data-link-type="biblio">[POWERFUL-FEATURES]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-secure-contexts" style="color:initial">secure contexts</span>
    </ul>
   <li>
    <a data-link-type="biblio">[proximity]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-proximity-sensor-interface" style="color:initial">proximitysensor</span>
    </ul>
   <li>
    <a data-link-type="biblio">[SECURITY-PRIVACY-QUESTIONNAIRE]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-sop-violations" style="color:initial">same-origin policy violations</span>
    </ul>
   <li>
    <a data-link-type="biblio">[WebDriver]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dfn-current-browsing-context" style="color:initial">current browsing context</span>
     <li><span class="dfn-paneled" id="term-for-dfn-extension-command-uri-template" style="color:initial">extension command uri template</span>
     <li><span class="dfn-paneled" id="term-for-dfn-extension-command" style="color:initial">extension commands</span>
     <li><span class="dfn-paneled" id="term-for-dfn-handle-any-user-prompts" style="color:initial">handle any user prompts</span>
     <li><span class="dfn-paneled" id="term-for-handling-errors" style="color:initial">handling errors</span>
     <li><span class="dfn-paneled" id="term-for-dfn-invalid-argument" style="color:initial">invalid argument</span>
     <li><span class="dfn-paneled" id="term-for-dfn-local-end" style="color:initial">local end</span>
     <li><span class="dfn-paneled" id="term-for-dfn-no-longer-open" style="color:initial">no longer open</span>
     <li><span class="dfn-paneled" id="term-for-dfn-no-such-window" style="color:initial">no such window</span>
     <li><span class="dfn-paneled" id="term-for-dfn-object" style="color:initial">object</span>
     <li><span class="dfn-paneled" id="term-for-dfn-remote-end-steps" style="color:initial">remote end steps</span>
     <li><span class="dfn-paneled" id="term-for-dfn-session" style="color:initial">session</span>
     <li><span class="dfn-paneled" id="term-for-dfn-success" style="color:initial">success</span>
     <li><span class="dfn-paneled" id="term-for-dfn-url-variables" style="color:initial">url variable</span>
     <li><span class="dfn-paneled" id="term-for-dfn-errors" style="color:initial">webdriver error</span>
     <li><span class="dfn-paneled" id="term-for-dfn-error-code" style="color:initial">webdriver error code</span>
    </ul>
   <li>
    <a data-link-type="biblio">[WebIDL]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-Constructor" style="color:initial">Constructor</span>
     <li><span class="dfn-paneled" id="term-for-idl-DOMException" style="color:initial">DOMException</span>
     <li><span class="dfn-paneled" id="term-for-idl-DOMString" style="color:initial">DOMString</span>
     <li><span class="dfn-paneled" id="term-for-Exposed" style="color:initial">Exposed</span>
     <li><span class="dfn-paneled" id="term-for-notallowederror" style="color:initial">NotAllowedError</span>
     <li><span class="dfn-paneled" id="term-for-notreadableerror" style="color:initial">NotReadableError</span>
     <li><span class="dfn-paneled" id="term-for-notsupportederror" style="color:initial">NotSupportedError</span>
     <li><span class="dfn-paneled" id="term-for-SecureContext" style="color:initial">SecureContext</span>
     <li><span class="dfn-paneled" id="term-for-dfn-attribute" style="color:initial">attribute</span>
     <li><span class="dfn-paneled" id="term-for-idl-boolean" style="color:initial">boolean</span>
     <li><span class="dfn-paneled" id="term-for-dfn-convert-ecmascript-to-idl-value" style="color:initial">converted to an idl value</span>
     <li><span class="dfn-paneled" id="term-for-dfn-create-exception" style="color:initial">created</span>
     <li><span class="dfn-paneled" id="term-for-dfn-dictionary" style="color:initial">dictionary</span>
     <li><span class="dfn-paneled" id="term-for-dfn-dictionary-member" style="color:initial">dictionary members</span>
     <li><span class="dfn-paneled" id="term-for-idl-double" style="color:initial">double</span>
     <li><span class="dfn-paneled" id="term-for-dfn-identifier" style="color:initial">identifier</span>
     <li><span class="dfn-paneled" id="term-for-dfn-inherited-dictionaries" style="color:initial">inherited dictionaries</span>
     <li><span class="dfn-paneled" id="term-for-dfn-inherited-interfaces" style="color:initial">inherited interfaces</span>
     <li><span class="dfn-paneled" id="term-for-dfn-interface" style="color:initial">interface</span>
     <li><span class="dfn-paneled" id="term-for-dfn-present" style="color:initial">present</span>
     <li><span class="dfn-paneled" id="term-for-dfn-read-only" style="color:initial">read only</span>
     <li><span class="dfn-paneled" id="term-for-dfn-throw" style="color:initial">throw</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-accelerometer">[ACCELEROMETER]
   <dd>Anssi Kostiainen. <a href="https://w3c.github.io/accelerometer/">Accelerometer</a>. URL: <a href="https://w3c.github.io/accelerometer/">https://w3c.github.io/accelerometer/</a>
   <dt id="biblio-ambient-light">[AMBIENT-LIGHT]
   <dd>Anssi Kostiainen. <a href="https://w3c.github.io/ambient-light/">Ambient Light Sensor</a>. URL: <a href="https://w3c.github.io/ambient-light/">https://w3c.github.io/ambient-light/</a>
   <dt id="biblio-dom">[DOM]
   <dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/">DOM Standard</a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a>
   <dt id="biblio-feature-policy">[FEATURE-POLICY]
   <dd>Ian Clelland. <a href="https://w3c.github.io/webappsec-feature-policy/">Feature Policy</a>. URL: <a href="https://w3c.github.io/webappsec-feature-policy/">https://w3c.github.io/webappsec-feature-policy/</a>
   <dt id="biblio-geolocation-sensor">[GEOLOCATION-SENSOR]
   <dd>Anssi Kostiainen; Thomas Steiner. <a href="https://w3c.github.io/geolocation-sensor/">Geolocation Sensor</a>. URL: <a href="https://w3c.github.io/geolocation-sensor/">https://w3c.github.io/geolocation-sensor/</a>
   <dt id="biblio-gyroscope">[GYROSCOPE]
   <dd>Anssi Kostiainen. <a href="https://w3c.github.io/gyroscope/">Gyroscope</a>. URL: <a href="https://w3c.github.io/gyroscope/">https://w3c.github.io/gyroscope/</a>
   <dt id="biblio-hr-time-2">[HR-TIME-2]
   <dd>Ilya Grigorik; James Simonsen; Jatinder Mann. <a href="https://w3c.github.io/hr-time/">High Resolution Time Level 2</a>. URL: <a href="https://w3c.github.io/hr-time/">https://w3c.github.io/hr-time/</a>
   <dt id="biblio-html">[HTML]
   <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/">HTML Standard</a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a>
   <dt id="biblio-infra">[INFRA]
   <dd>Anne van Kesteren; Domenic Denicola. <a href="https://infra.spec.whatwg.org/">Infra Standard</a>. Living Standard. URL: <a href="https://infra.spec.whatwg.org/">https://infra.spec.whatwg.org/</a>
   <dt id="biblio-magnetometer">[MAGNETOMETER]
   <dd>Anssi Kostiainen; Rijubrata Bhaumik. <a href="https://w3c.github.io/magnetometer/">Magnetometer</a>. URL: <a href="https://w3c.github.io/magnetometer/">https://w3c.github.io/magnetometer/</a>
   <dt id="biblio-orientation-sensor">[ORIENTATION-SENSOR]
   <dd>Kenneth Christiansen; Anssi Kostiainen. <a href="https://w3c.github.io/orientation-sensor/">Orientation Sensor</a>. URL: <a href="https://w3c.github.io/orientation-sensor/">https://w3c.github.io/orientation-sensor/</a>
   <dt id="biblio-page-visibility">[PAGE-VISIBILITY]
   <dd>Jatinder Mann; Arvind Jain. <a href="https://www.w3.org/TR/page-visibility/">Page Visibility (Second Edition)</a>. 29 October 2013. REC. URL: <a href="https://www.w3.org/TR/page-visibility/">https://www.w3.org/TR/page-visibility/</a>
   <dt id="biblio-permissions">[PERMISSIONS]
   <dd>Mounir Lamouri; Marcos Caceres; Jeffrey Yasskin. <a href="https://w3c.github.io/permissions/">Permissions</a>. URL: <a href="https://w3c.github.io/permissions/">https://w3c.github.io/permissions/</a>
   <dt id="biblio-permissions-request">[PERMISSIONS-REQUEST]
   <dd><a href="https://wicg.github.io/permissions-request/">Requesting Permissions</a>. Living Standard. URL: <a href="https://wicg.github.io/permissions-request/">https://wicg.github.io/permissions-request/</a>
   <dt id="biblio-powerful-features">[POWERFUL-FEATURES]
   <dd>Mike West. <a href="https://w3c.github.io/webappsec-secure-contexts/">Secure Contexts</a>. URL: <a href="https://w3c.github.io/webappsec-secure-contexts/">https://w3c.github.io/webappsec-secure-contexts/</a>
   <dt id="biblio-proximity">[PROXIMITY]
   <dd>Anssi Kostiainen; Rijubrata Bhaumik. <a href="https://w3c.github.io/proximity/">Proximity Sensor</a>. URL: <a href="https://w3c.github.io/proximity/">https://w3c.github.io/proximity/</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
   <dt id="biblio-webdriver">[WebDriver]
   <dd>Simon Stewart; David Burns. <a href="https://w3c.github.io/webdriver/">WebDriver</a>. URL: <a href="https://w3c.github.io/webdriver/">https://w3c.github.io/webdriver/</a>
   <dt id="biblio-webidl">[WebIDL]
   <dd>Boris Zbarsky. <a href="https://heycam.github.io/webidl/">Web IDL</a>. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
  </dl>
  <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
  <dl>
   <dt id="biblio-accelprint">[ACCELPRINT]
   <dd>Dey, Sanorita, et al.. <a href="http://synrg.csl.illinois.edu/papers/AccelPrint_NDSS14.pdf">AccelPrint: Imperfections of Accelerometers Make Smartphones Trackable</a>. 2014. Informational. URL: <a href="http://synrg.csl.illinois.edu/papers/AccelPrint_NDSS14.pdf">http://synrg.csl.illinois.edu/papers/AccelPrint_NDSS14.pdf</a>
   <dt id="biblio-api-design-principles">[API-DESIGN-PRINCIPLES]
   <dd>Domenic Denicola. <a href="https://w3ctag.github.io/design-principles/">API Design Principles</a>. 29 December 2015. URL: <a href="https://w3ctag.github.io/design-principles/">https://w3ctag.github.io/design-principles/</a>
   <dt id="biblio-coordinates-transformation">[COORDINATES-TRANSFORMATION]
   <dd>George W. Collins, II. <a href="http://ads.harvard.edu/books/1989fcm..book/Chapter2.pdf">The Foundations of Celestial Mechanics</a>. 2004. Informational. URL: <a href="http://ads.harvard.edu/books/1989fcm..book/Chapter2.pdf">http://ads.harvard.edu/books/1989fcm..book/Chapter2.pdf</a>
   <dt id="biblio-extennnnsible">[EXTENNNNSIBLE]
   <dd><a href="https://extensiblewebmanifesto.org/">The Extensible Web Manifesto</a>. 10 June 2013. URL: <a href="https://extensiblewebmanifesto.org/">https://extensiblewebmanifesto.org/</a>
   <dt id="biblio-generic-sensor-usecases">[GENERIC-SENSOR-USECASES]
   <dd>Rick Waldron, Mikhail Pozdnyakov, Alexander Shalamov. <a href="https://w3c.github.io/sensors/usecases">Sensor Use Cases</a>. 2017. Note. URL: <a href="https://w3c.github.io/sensors/usecases">https://w3c.github.io/sensors/usecases</a>
   <dt id="biblio-geolocation-api">[GEOLOCATION-API]
   <dd>Andrei Popescu. <a href="http://dev.w3.org/geo/api/spec-source.html">Geolocation API Specification 2nd Edition</a>. URL: <a href="http://dev.w3.org/geo/api/spec-source.html">http://dev.w3.org/geo/api/spec-source.html</a>
   <dt id="biblio-gyrospeechrecognition">[GYROSPEECHRECOGNITION]
   <dd>Michalevsky, Y., Boneh, D. and Nakibly, G.. <a href="https://www.usenix.org/system/files/conference/usenixsecurity14/sec14-paper-michalevsky.pdf">Gyrophone: Recognizing Speech from Gyroscope Signals</a>. 2014. Informational. URL: <a href="https://www.usenix.org/system/files/conference/usenixsecurity14/sec14-paper-michalevsky.pdf">https://www.usenix.org/system/files/conference/usenixsecurity14/sec14-paper-michalevsky.pdf</a>
   <dt id="biblio-mobilesensors">[MOBILESENSORS]
   <dd>Manish J. Gajjar. Mobile Sensors and Context-Aware Computing. 2017. Informational. 
   <dt id="biblio-motion-sensors">[MOTION-SENSORS]
   <dd>Kenneth Christiansen; Alexander Shalamov. <a href="https://w3c.github.io/motion-sensors/">Motion Sensors Explainer</a>. URL: <a href="https://w3c.github.io/motion-sensors/">https://w3c.github.io/motion-sensors/</a>
   <dt id="biblio-orientation-event">[ORIENTATION-EVENT]
   <dd>Rich Tibbett; et al. <a href="https://w3c.github.io/deviceorientation/spec-source-orientation.html">DeviceOrientation Event Specification</a>. URL: <a href="https://w3c.github.io/deviceorientation/spec-source-orientation.html">https://w3c.github.io/deviceorientation/spec-source-orientation.html</a>
   <dt id="biblio-qudt">[QUDT]
   <dd>Ralph Hodgson; et al. <a href="http://www.qudt.org/">QUDT - Quantities, Units, Dimensions and Data Types Ontologies</a>. 18 March 2014. URL: <a href="http://www.qudt.org/">http://www.qudt.org/</a>
   <dt id="biblio-rfc6454">[RFC6454]
   <dd>A. Barth. <a href="https://tools.ietf.org/html/rfc6454">The Web Origin Concept</a>. December 2011. Proposed Standard. URL: <a href="https://tools.ietf.org/html/rfc6454">https://tools.ietf.org/html/rfc6454</a>
   <dt id="biblio-security-privacy-questionnaire">[SECURITY-PRIVACY-QUESTIONNAIRE]
   <dd>Lukasz Olejnik; Jason Novak. <a href="https://w3ctag.github.io/security-questionnaire/">Self-Review Questionnaire: Security and Privacy</a>. URL: <a href="https://w3ctag.github.io/security-questionnaire/">https://w3ctag.github.io/security-questionnaire/</a>
   <dt id="biblio-si">[SI]
   <dd><a href="http://www.bipm.org/en/publications/si-brochure/">SI Brochure: The International System of Units (SI), 8th edition</a>. 2014. URL: <a href="http://www.bipm.org/en/publications/si-brochure/">http://www.bipm.org/en/publications/si-brochure/</a>
   <dt id="biblio-stealingpinsviasensors">[STEALINGPINSVIASENSORS]
   <dd>Maryam Mehrnezhad, Ehsan Toreini, Siamak F. Shahandashti, Feng Hao. <a href="https://rd.springer.com/article/10.1007/s10207-017-0369-x?wt_mc=Internal.Event.1.SEM.ArticleAuthorOnlineFirst">Stealing PINs via mobile sensors: actual risk versus user perception</a>. 2017. Informational. URL: <a href="https://rd.springer.com/article/10.1007/s10207-017-0369-x?wt_mc=Internal.Event.1.SEM.ArticleAuthorOnlineFirst">https://rd.springer.com/article/10.1007/s10207-017-0369-x?wt_mc=Internal.Event.1.SEM.ArticleAuthorOnlineFirst</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext②"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②"><c- g>Exposed</c-></a>=(<c- n>DedicatedWorker</c->, <c- n>Window</c->)]
<c- b>interface</c-> <a href="#sensor"><code><c- g>Sensor</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget①"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean③"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-sensor-activated"><code><c- g>activated</c-></code></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①①"><c- b>boolean</c-></a> <a data-readonly data-type="boolean" href="#dom-sensor-hasreading"><code><c- g>hasReading</c-></code></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/hr-time-2/#dom-domhighrestimestamp" id="ref-for-dom-domhighrestimestamp①"><c- n>DOMHighResTimeStamp</c-></a>? <a data-readonly data-type="DOMHighResTimeStamp?" href="#dom-sensor-timestamp"><code><c- g>timestamp</c-></code></a>;
  <c- b>void</c-> <a href="#dom-sensor-start"><code><c- g>start</c-></code></a>();
  <c- b>void</c-> <a href="#dom-sensor-stop"><code><c- g>stop</c-></code></a>();
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑥"><c- n>EventHandler</c-></a> <a data-type="EventHandler" href="#dom-sensor-onreading"><code><c- g>onreading</c-></code></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler①①"><c- n>EventHandler</c-></a> <a data-type="EventHandler" href="#dom-sensor-onactivate"><code><c- g>onactivate</c-></code></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler②①"><c- n>EventHandler</c-></a> <a data-type="EventHandler" href="#dom-sensor-onerror"><code><c- g>onerror</c-></code></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-sensoroptions"><code><c- g>SensorOptions</c-></code></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-double" id="ref-for-idl-double⑥"><c- b>double</c-></a> <a data-type="double " href="#dom-sensoroptions-frequency"><code><c- g>frequency</c-></code></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①①"><c- g>Exposed</c-></a>=(<c- n>DedicatedWorker</c->, <c- n>Window</c->)]
<c- b>interface</c-> <a href="#sensorerrorevent"><code><c- g>SensorErrorEvent</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event①"><c- n>Event</c-></a> {
  <a href="#dom-sensorerrorevent-sensorerrorevent"><code><c- g>constructor</c-></code></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①"><c- b>DOMString</c-></a> <a href="#dom-sensorerrorevent-sensorerrorevent-type-erroreventinitdict-type"><code><c- g>type</c-></code></a>, <a class="n" data-link-type="idl-name" href="#dictdef-sensorerroreventinit" id="ref-for-dictdef-sensorerroreventinit②"><c- n>SensorErrorEventInit</c-></a> <a href="#dom-sensorerrorevent-sensorerrorevent-type-erroreventinitdict-erroreventinitdict"><code><c- g>errorEventInitDict</c-></code></a>);
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException②①"><c- n>DOMException</c-></a> <a data-readonly data-type="DOMException" href="#dom-sensorerrorevent-error"><code><c- g>error</c-></code></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-sensorerroreventinit"><code><c- g>SensorErrorEventInit</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit①"><c- n>EventInit</c-></a> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException③①"><c- n>DOMException</c-></a> <a data-type="DOMException " href="#dom-sensorerroreventinit-error"><code><c- g>error</c-></code></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-mocksensorconfiguration"><code><c- g>MockSensorConfiguration</c-></code></a> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#enumdef-mocksensortype" id="ref-for-enumdef-mocksensortype⑦"><c- n>MockSensorType</c-></a> <a data-type="MockSensorType " href="#dom-mocksensorconfiguration-mocksensortype"><code><c- g>mockSensorType</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②①"><c- b>boolean</c-></a> <a data-default="true" data-type="boolean " href="#dom-mocksensorconfiguration-connected"><code><c- g>connected</c-></code></a> = <c- b>true</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-double" id="ref-for-idl-double①①"><c- b>double</c-></a>? <a data-type="double? " href="#dom-mocksensorconfiguration-maxsamplingfrequency"><code><c- g>maxSamplingFrequency</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-double" id="ref-for-idl-double②①"><c- b>double</c-></a>? <a data-type="double? " href="#dom-mocksensorconfiguration-minsamplingfrequency"><code><c- g>minSamplingFrequency</c-></code></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-mocksensor"><code><c- g>MockSensor</c-></code></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-double" id="ref-for-idl-double③①"><c- b>double</c-></a> <a data-type="double " href="#dom-mocksensor-maxsamplingfrequency"><code><c- g>maxSamplingFrequency</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-double" id="ref-for-idl-double④①"><c- b>double</c-></a> <a data-type="double " href="#dom-mocksensor-minsamplingfrequency"><code><c- g>minSamplingFrequency</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-double" id="ref-for-idl-double⑤①"><c- b>double</c-></a> <a data-type="double " href="#dom-mocksensor-requestedsamplingfrequency"><code><c- g>requestedSamplingFrequency</c-></code></a>;
};

<c- b>enum</c-> <a href="#enumdef-mocksensortype"><code><c- g>MockSensorType</c-></code></a> {
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-ambient-light" id="ref-for-dom-mocksensortype-ambient-light①"><c- s>"ambient-light"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-accelerometer" id="ref-for-dom-mocksensortype-accelerometer①"><c- s>"accelerometer"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-linear-acceleration" id="ref-for-dom-mocksensortype-linear-acceleration①"><c- s>"linear-acceleration"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-gravity" id="ref-for-dom-mocksensortype-gravity①"><c- s>"gravity"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-gyroscope" id="ref-for-dom-mocksensortype-gyroscope①"><c- s>"gyroscope"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-magnetometer" id="ref-for-dom-mocksensortype-magnetometer①"><c- s>"magnetometer"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-uncalibrated-magnetometer" id="ref-for-dom-mocksensortype-uncalibrated-magnetometer①"><c- s>"uncalibrated-magnetometer"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-absolute-orientation" id="ref-for-dom-mocksensortype-absolute-orientation①"><c- s>"absolute-orientation"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-relative-orientation" id="ref-for-dom-mocksensortype-relative-orientation①"><c- s>"relative-orientation"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-geolocation" id="ref-for-dom-mocksensortype-geolocation①"><c- s>"geolocation"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-mocksensortype-proximity" id="ref-for-dom-mocksensortype-proximity①"><c- s>"proximity"</c-></a>,
};

<c- b>dictionary</c-> <a href="#dictdef-mocksensorreadingvalues"><code><c- g>MockSensorReadingValues</c-></code></a> {
};

</pre>
  <aside class="dfn-panel" data-for="limit-max-frequency">
   <b><a href="#limit-max-frequency">#limit-max-frequency</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-limit-max-frequency">4.3.3. Limit number of delivered readings</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="concept-device-sensor">
   <b><a href="#concept-device-sensor">#concept-device-sensor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-device-sensor">2. Scope</a>
    <li><a href="#ref-for-concept-device-sensor①">4. Security and privacy considerations</a> <a href="#ref-for-concept-device-sensor②">(2)</a> <a href="#ref-for-concept-device-sensor③">(3)</a> <a href="#ref-for-concept-device-sensor④">(4)</a>
    <li><a href="#ref-for-concept-device-sensor⑤">5.1. Sensors</a> <a href="#ref-for-concept-device-sensor⑥">(2)</a> <a href="#ref-for-concept-device-sensor⑦">(3)</a> <a href="#ref-for-concept-device-sensor⑧">(4)</a> <a href="#ref-for-concept-device-sensor⑨">(5)</a> <a href="#ref-for-concept-device-sensor①⓪">(6)</a> <a href="#ref-for-concept-device-sensor①①">(7)</a> <a href="#ref-for-concept-device-sensor①②">(8)</a> <a href="#ref-for-concept-device-sensor①③">(9)</a> <a href="#ref-for-concept-device-sensor①④">(10)</a> <a href="#ref-for-concept-device-sensor①⑤">(11)</a>
    <li><a href="#ref-for-concept-device-sensor①⑥">5.3. Default sensor</a> <a href="#ref-for-concept-device-sensor①⑦">(2)</a> <a href="#ref-for-concept-device-sensor①⑧">(3)</a> <a href="#ref-for-concept-device-sensor①⑨">(4)</a> <a href="#ref-for-concept-device-sensor②⓪">(5)</a> <a href="#ref-for-concept-device-sensor②①">(6)</a> <a href="#ref-for-concept-device-sensor②②">(7)</a>
    <li><a href="#ref-for-concept-device-sensor②③">5.4. Reading change threshold</a> <a href="#ref-for-concept-device-sensor②④">(2)</a>
    <li><a href="#ref-for-concept-device-sensor②⑤">5.5. Sampling Frequency and Reporting Frequency</a>
    <li><a href="#ref-for-concept-device-sensor②⑥">6.2. Sensor</a> <a href="#ref-for-concept-device-sensor②⑦">(2)</a>
    <li><a href="#ref-for-concept-device-sensor②⑧">7.1.1. Sensor lifecycle</a>
    <li><a href="#ref-for-concept-device-sensor②⑨">8.3. Connect to sensor</a> <a href="#ref-for-concept-device-sensor③⓪">(2)</a> <a href="#ref-for-concept-device-sensor③①">(3)</a>
    <li><a href="#ref-for-concept-device-sensor③②">10.6. Definition Requirements</a>
    <li><a href="#ref-for-concept-device-sensor③③">10.10. Example WebIDL</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="sensor-reading">
   <b><a href="#sensor-reading">#sensor-reading</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sensor-reading">4. Security and privacy considerations</a> <a href="#ref-for-sensor-reading①">(2)</a>
    <li><a href="#ref-for-sensor-reading②">4.1.1. Location Tracking</a>
    <li><a href="#ref-for-sensor-reading③">4.1.2. Eavesdropping</a>
    <li><a href="#ref-for-sensor-reading④">4.1.3. Keystroke Monitoring</a>
    <li><a href="#ref-for-sensor-reading⑤">4.1.5. User Identifying</a>
    <li><a href="#ref-for-sensor-reading⑥">4.2.1. Secure Context</a>
    <li><a href="#ref-for-sensor-reading⑦">4.2.2. Feature Policy</a> <a href="#ref-for-sensor-reading⑧">(2)</a>
    <li><a href="#ref-for-sensor-reading⑨">4.2.3. Focused Area</a>
    <li><a href="#ref-for-sensor-reading①⓪">4.2.4. Visibility State</a>
    <li><a href="#ref-for-sensor-reading①①">4.2.5. Permissions API</a>
    <li><a href="#ref-for-sensor-reading①②">4.3.3. Limit number of delivered readings</a>
    <li><a href="#ref-for-sensor-reading①③">4.3.4. Reduce accuracy</a> <a href="#ref-for-sensor-reading①④">(2)</a> <a href="#ref-for-sensor-reading①⑤">(3)</a>
    <li><a href="#ref-for-sensor-reading①⑥">4.3.5. Keep the user informed about API use</a>
    <li><a href="#ref-for-sensor-reading①⑦">5.1. Sensors</a> <a href="#ref-for-sensor-reading①⑧">(2)</a> <a href="#ref-for-sensor-reading①⑨">(3)</a> <a href="#ref-for-sensor-reading②⓪">(4)</a> <a href="#ref-for-sensor-reading②①">(5)</a> <a href="#ref-for-sensor-reading②②">(6)</a>
    <li><a href="#ref-for-sensor-reading②③">5.2. Sensor Types</a> <a href="#ref-for-sensor-reading②④">(2)</a> <a href="#ref-for-sensor-reading②⑤">(3)</a> <a href="#ref-for-sensor-reading②⑥">(4)</a>
    <li><a href="#ref-for-sensor-reading②⑦">5.3. Default sensor</a>
    <li><a href="#ref-for-sensor-reading②⑧">5.4. Reading change threshold</a> <a href="#ref-for-sensor-reading②⑨">(2)</a>
    <li><a href="#ref-for-sensor-reading③⓪">5.5. Sampling Frequency and Reporting Frequency</a> <a href="#ref-for-sensor-reading③①">(2)</a> <a href="#ref-for-sensor-reading③②">(3)</a> <a href="#ref-for-sensor-reading③③">(4)</a>
    <li><a href="#ref-for-sensor-reading③④">6.2. Sensor</a> <a href="#ref-for-sensor-reading③⑤">(2)</a> <a href="#ref-for-sensor-reading③⑥">(3)</a> <a href="#ref-for-sensor-reading③⑦">(4)</a>
    <li><a href="#ref-for-sensor-reading③⑧">7.1. The Sensor Interface</a> <a href="#ref-for-sensor-reading③⑨">(2)</a>
    <li><a href="#ref-for-sensor-reading④⓪">7.1.3. Sensor internal slots</a> <a href="#ref-for-sensor-reading④①">(2)</a>
    <li><a href="#ref-for-sensor-reading④②">7.1.9. Sensor.onreading</a>
    <li><a href="#ref-for-sensor-reading④③">8.3. Connect to sensor</a> <a href="#ref-for-sensor-reading④④">(2)</a>
    <li><a href="#ref-for-sensor-reading④⑤">8.7. Set sensor settings</a> <a href="#ref-for-sensor-reading④⑥">(2)</a>
    <li><a href="#ref-for-sensor-reading④⑦">8.8. Update latest reading</a>
    <li><a href="#ref-for-sensor-reading④⑧">8.14. Get value from latest reading</a>
    <li><a href="#ref-for-sensor-reading④⑨">9.1. Mock Sensors</a>
    <li><a href="#ref-for-sensor-reading⑤⓪">10. Extensibility</a>
    <li><a href="#ref-for-sensor-reading⑤①">10.2. Naming</a> <a href="#ref-for-sensor-reading⑤②">(2)</a>
    <li><a href="#ref-for-sensor-reading⑤③">10.3. Unit</a>
    <li><a href="#ref-for-sensor-reading⑤④">10.5. When is Enabling Multiple Sensors of the Same Type Not the Right Choice?</a>
    <li><a href="#ref-for-sensor-reading⑤⑤">10.6. Definition Requirements</a>
    <li><a href="#ref-for-sensor-reading⑤⑥">10.8. Extending the Permission API</a> <a href="#ref-for-sensor-reading⑤⑦">(2)</a>
    <li><a href="#ref-for-sensor-reading⑤⑧">10.9. Extending the Feature Policy API</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="reading-timestamp">
   <b><a href="#reading-timestamp">#reading-timestamp</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-reading-timestamp">4.3.4. Reduce accuracy</a> <a href="#ref-for-reading-timestamp①">(2)</a>
    <li><a href="#ref-for-reading-timestamp②">6.2. Sensor</a> <a href="#ref-for-reading-timestamp③">(2)</a>
    <li><a href="#ref-for-reading-timestamp④">7.1.6. Sensor.timestamp</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="local-coordinate-system">
   <b><a href="#local-coordinate-system">#local-coordinate-system</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-local-coordinate-system">5.1. Sensors</a> <a href="#ref-for-local-coordinate-system①">(2)</a>
    <li><a href="#ref-for-local-coordinate-system②">8.14. Get value from latest reading</a> <a href="#ref-for-local-coordinate-system③">(2)</a>
    <li><a href="#ref-for-local-coordinate-system④">10. Extensibility</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="spatial-sensor">
   <b><a href="#spatial-sensor">#spatial-sensor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-spatial-sensor">5.1. Sensors</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="triaxial">
   <b><a href="#triaxial">#triaxial</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-triaxial">5.2. Sensor Types</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="concept-platform-sensor">
   <b><a href="#concept-platform-sensor">#concept-platform-sensor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-platform-sensor">5.1. Sensors</a> <a href="#ref-for-concept-platform-sensor①">(2)</a> <a href="#ref-for-concept-platform-sensor②">(3)</a> <a href="#ref-for-concept-platform-sensor③">(4)</a> <a href="#ref-for-concept-platform-sensor④">(5)</a> <a href="#ref-for-concept-platform-sensor⑤">(6)</a>
    <li><a href="#ref-for-concept-platform-sensor⑥">5.4. Reading change threshold</a>
    <li><a href="#ref-for-concept-platform-sensor⑦">5.5. Sampling Frequency and Reporting Frequency</a>
    <li><a href="#ref-for-concept-platform-sensor⑧">5.6. Conditions to expose sensor readings</a>
    <li><a href="#ref-for-concept-platform-sensor⑨">6.2. Sensor</a> <a href="#ref-for-concept-platform-sensor①⓪">(2)</a> <a href="#ref-for-concept-platform-sensor①①">(3)</a> <a href="#ref-for-concept-platform-sensor①②">(4)</a> <a href="#ref-for-concept-platform-sensor①③">(5)</a> <a href="#ref-for-concept-platform-sensor①④">(6)</a> <a href="#ref-for-concept-platform-sensor①⑤">(7)</a> <a href="#ref-for-concept-platform-sensor①⑥">(8)</a>
    <li><a href="#ref-for-concept-platform-sensor①⑦">7.1. The Sensor Interface</a> <a href="#ref-for-concept-platform-sensor①⑧">(2)</a> <a href="#ref-for-concept-platform-sensor①⑨">(3)</a>
    <li><a href="#ref-for-concept-platform-sensor②⓪">7.1.1. Sensor lifecycle</a>
    <li><a href="#ref-for-concept-platform-sensor②①">7.1.3. Sensor internal slots</a>
    <li><a href="#ref-for-concept-platform-sensor②②">8.3. Connect to sensor</a> <a href="#ref-for-concept-platform-sensor②③">(2)</a> <a href="#ref-for-concept-platform-sensor②④">(3)</a>
    <li><a href="#ref-for-concept-platform-sensor②⑤">8.4. Activate a sensor object</a>
    <li><a href="#ref-for-concept-platform-sensor②⑥">8.5. Deactivate a sensor object</a>
    <li><a href="#ref-for-concept-platform-sensor②⑦">8.6. Revoke sensor permission</a>
    <li><a href="#ref-for-concept-platform-sensor②⑧">8.7. Set sensor settings</a>
    <li><a href="#ref-for-concept-platform-sensor②⑨">8.8. Update latest reading</a>
    <li><a href="#ref-for-concept-platform-sensor③⓪">8.9. Find the reporting frequency of a sensor object</a>
    <li><a href="#ref-for-concept-platform-sensor③①">8.12. Notify activated state</a>
    <li><a href="#ref-for-concept-platform-sensor③②">8.14. Get value from latest reading</a>
    <li><a href="#ref-for-concept-platform-sensor③③">8.15. Request sensor access</a>
    <li><a href="#ref-for-concept-platform-sensor③④">9.1. Mock Sensors</a>
    <li><a href="#ref-for-concept-platform-sensor③⑤">9.2.1. Create mock sensor</a>
    <li><a href="#ref-for-concept-platform-sensor③⑥">10.2. Naming</a> <a href="#ref-for-concept-platform-sensor③⑦">(2)</a> <a href="#ref-for-concept-platform-sensor③⑧">(3)</a>
    <li><a href="#ref-for-concept-platform-sensor③⑨">10.6. Definition Requirements</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="calibration">
   <b><a href="#calibration">#calibration</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-calibration">5.2. Sensor Types</a>
    <li><a href="#ref-for-calibration①">10. Extensibility</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="low-level">
   <b><a href="#low-level">#low-level</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-low-level">1. Introduction</a>
    <li><a href="#ref-for-low-level①">5.2. Sensor Types</a> <a href="#ref-for-low-level②">(2)</a> <a href="#ref-for-low-level③">(3)</a> <a href="#ref-for-low-level④">(4)</a> <a href="#ref-for-low-level⑤">(5)</a> <a href="#ref-for-low-level⑥">(6)</a>
    <li><a href="#ref-for-low-level⑦">10. Extensibility</a>
    <li><a href="#ref-for-low-level⑧">10.2. Naming</a>
    <li><a href="#ref-for-low-level⑨">10.4. Exposing High-Level vs. Low-Level Sensors</a> <a href="#ref-for-low-level①⓪">(2)</a> <a href="#ref-for-low-level①①">(3)</a>
    <li><a href="#ref-for-low-level①②">10.8. Extending the Permission API</a> <a href="#ref-for-low-level①③">(2)</a>
    <li><a href="#ref-for-low-level①④">10.9. Extending the Feature Policy API</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="high-level">
   <b><a href="#high-level">#high-level</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-high-level">1. Introduction</a>
    <li><a href="#ref-for-high-level①">5.2. Sensor Types</a> <a href="#ref-for-high-level②">(2)</a> <a href="#ref-for-high-level③">(3)</a> <a href="#ref-for-high-level④">(4)</a> <a href="#ref-for-high-level⑤">(5)</a> <a href="#ref-for-high-level⑥">(6)</a>
    <li><a href="#ref-for-high-level⑦">10. Extensibility</a>
    <li><a href="#ref-for-high-level⑧">10.2. Naming</a>
    <li><a href="#ref-for-high-level⑨">10.4. Exposing High-Level vs. Low-Level Sensors</a> <a href="#ref-for-high-level①⓪">(2)</a> <a href="#ref-for-high-level①①">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="sensor-fusion">
   <b><a href="#sensor-fusion">#sensor-fusion</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sensor-fusion">5.1. Sensors</a> <a href="#ref-for-sensor-fusion①">(2)</a> <a href="#ref-for-sensor-fusion②">(3)</a>
    <li><a href="#ref-for-sensor-fusion③">5.2. Sensor Types</a> <a href="#ref-for-sensor-fusion④">(2)</a> <a href="#ref-for-sensor-fusion⑤">(3)</a> <a href="#ref-for-sensor-fusion⑥">(4)</a> <a href="#ref-for-sensor-fusion⑦">(5)</a>
    <li><a href="#ref-for-sensor-fusion⑧">10.6. Definition Requirements</a>
    <li><a href="#ref-for-sensor-fusion⑨">10.8. Extending the Permission API</a>
    <li><a href="#ref-for-sensor-fusion①⓪">10.9. Extending the Feature Policy API</a> <a href="#ref-for-sensor-fusion①①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="default-sensor">
   <b><a href="#default-sensor">#default-sensor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-default-sensor">5.3. Default sensor</a> <a href="#ref-for-default-sensor①">(2)</a> <a href="#ref-for-default-sensor②">(3)</a>
    <li><a href="#ref-for-default-sensor③">6.1. Sensor Type</a>
    <li><a href="#ref-for-default-sensor④">8.3. Connect to sensor</a> <a href="#ref-for-default-sensor⑤">(2)</a>
    <li><a href="#ref-for-default-sensor⑥">10.6. Definition Requirements</a> <a href="#ref-for-default-sensor⑦">(2)</a> <a href="#ref-for-default-sensor⑧">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="reading-change-threshold">
   <b><a href="#reading-change-threshold">#reading-change-threshold</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-reading-change-threshold">5.4. Reading change threshold</a> <a href="#ref-for-reading-change-threshold①">(2)</a>
    <li><a href="#ref-for-reading-change-threshold②">5.5. Sampling Frequency and Reporting Frequency</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="sampling-frequency">
   <b><a href="#sampling-frequency">#sampling-frequency</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sampling-frequency">4.3.1. Limit maximum sampling frequency</a> <a href="#ref-for-sampling-frequency①">(2)</a>
    <li><a href="#ref-for-sampling-frequency②">4.3.3. Limit number of delivered readings</a>
    <li><a href="#ref-for-sampling-frequency③">5.5. Sampling Frequency and Reporting Frequency</a> <a href="#ref-for-sampling-frequency④">(2)</a> <a href="#ref-for-sampling-frequency⑤">(3)</a> <a href="#ref-for-sampling-frequency⑥">(4)</a>
    <li><a href="#ref-for-sampling-frequency⑦">6.2. Sensor</a> <a href="#ref-for-sampling-frequency⑧">(2)</a>
    <li><a href="#ref-for-sampling-frequency⑨">8.1. Initialize a sensor object</a>
    <li><a href="#ref-for-sampling-frequency①⓪">8.9. Find the reporting frequency of a sensor object</a>
    <li><a href="#ref-for-sampling-frequency①①">9.1. Mock Sensors</a> <a href="#ref-for-sampling-frequency①②">(2)</a>
    <li><a href="#ref-for-sampling-frequency①③">9.1.1. MockSensorConfiguration dictionary</a> <a href="#ref-for-sampling-frequency①④">(2)</a>
    <li><a href="#ref-for-sampling-frequency①⑤">9.1.2. MockSensor dictionary</a> <a href="#ref-for-sampling-frequency①⑥">(2)</a>
    <li><a href="#ref-for-sampling-frequency①⑦">10.8. Extending the Permission API</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="requested-sampling-frequency">
   <b><a href="#requested-sampling-frequency">#requested-sampling-frequency</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-requested-sampling-frequency">5.5. Sampling Frequency and Reporting Frequency</a> <a href="#ref-for-requested-sampling-frequency①">(2)</a> <a href="#ref-for-requested-sampling-frequency②">(3)</a>
    <li><a href="#ref-for-requested-sampling-frequency③">6.2. Sensor</a> <a href="#ref-for-requested-sampling-frequency④">(2)</a> <a href="#ref-for-requested-sampling-frequency⑤">(3)</a>
    <li><a href="#ref-for-requested-sampling-frequency⑥">7.1.3. Sensor internal slots</a>
    <li><a href="#ref-for-requested-sampling-frequency⑦">8.7. Set sensor settings</a> <a href="#ref-for-requested-sampling-frequency⑧">(2)</a>
    <li><a href="#ref-for-requested-sampling-frequency⑨">9.1. Mock Sensors</a> <a href="#ref-for-requested-sampling-frequency①⓪">(2)</a>
    <li><a href="#ref-for-requested-sampling-frequency①①">9.1.2. MockSensor dictionary</a>
    <li><a href="#ref-for-requested-sampling-frequency①②">10.5. When is Enabling Multiple Sensors of the Same Type Not the Right Choice?</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="reporting-frequency">
   <b><a href="#reporting-frequency">#reporting-frequency</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-reporting-frequency">5.5. Sampling Frequency and Reporting Frequency</a>
    <li><a href="#ref-for-reporting-frequency①">7.1.3. Sensor internal slots</a>
    <li><a href="#ref-for-reporting-frequency②">8.9. Find the reporting frequency of a sensor object</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="can-expose-sensor-readings">
   <b><a href="#can-expose-sensor-readings">#can-expose-sensor-readings</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-can-expose-sensor-readings">5.6. Conditions to expose sensor readings</a>
    <li><a href="#ref-for-can-expose-sensor-readings①">6.2. Sensor</a>
    <li><a href="#ref-for-can-expose-sensor-readings②">9.1. Mock Sensors</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="mandatory-conditions">
   <b><a href="#mandatory-conditions">#mandatory-conditions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mandatory-conditions">5.6. Conditions to expose sensor readings</a> <a href="#ref-for-mandatory-conditions①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="sensor-type">
   <b><a href="#sensor-type">#sensor-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sensor-type">4. Security and privacy considerations</a>
    <li><a href="#ref-for-sensor-type①">4.2.2. Feature Policy</a>
    <li><a href="#ref-for-sensor-type②">4.3. Mitigation strategies applied on a case by case basis</a>
    <li><a href="#ref-for-sensor-type③">4.3.1. Limit maximum sampling frequency</a>
    <li><a href="#ref-for-sensor-type④">5.1. Sensors</a>
    <li><a href="#ref-for-sensor-type⑤">5.2. Sensor Types</a> <a href="#ref-for-sensor-type⑥">(2)</a> <a href="#ref-for-sensor-type⑦">(3)</a> <a href="#ref-for-sensor-type⑧">(4)</a> <a href="#ref-for-sensor-type⑨">(5)</a> <a href="#ref-for-sensor-type①⓪">(6)</a> <a href="#ref-for-sensor-type①①">(7)</a> <a href="#ref-for-sensor-type①②">(8)</a>
    <li><a href="#ref-for-sensor-type①③">5.3. Default sensor</a> <a href="#ref-for-sensor-type①④">(2)</a> <a href="#ref-for-sensor-type①⑤">(3)</a> <a href="#ref-for-sensor-type①⑥">(4)</a> <a href="#ref-for-sensor-type①⑦">(5)</a> <a href="#ref-for-sensor-type①⑧">(6)</a>
    <li><a href="#ref-for-sensor-type①⑨">5.5. Sampling Frequency and Reporting Frequency</a>
    <li><a href="#ref-for-sensor-type②⓪">5.6. Conditions to expose sensor readings</a> <a href="#ref-for-sensor-type②①">(2)</a> <a href="#ref-for-sensor-type②②">(3)</a>
    <li><a href="#ref-for-sensor-type②③">6.1. Sensor Type</a> <a href="#ref-for-sensor-type②④">(2)</a> <a href="#ref-for-sensor-type②⑤">(3)</a> <a href="#ref-for-sensor-type②⑥">(4)</a> <a href="#ref-for-sensor-type②⑦">(5)</a> <a href="#ref-for-sensor-type②⑧">(6)</a> <a href="#ref-for-sensor-type②⑨">(7)</a>
    <li><a href="#ref-for-sensor-type③⓪">6.2. Sensor</a>
    <li><a href="#ref-for-sensor-type③①">8.2. Check sensor policy-controlled features</a>
    <li><a href="#ref-for-sensor-type③②">8.3. Connect to sensor</a>
    <li><a href="#ref-for-sensor-type③③">9.1.3. Mock sensor type</a> <a href="#ref-for-sensor-type③④">(2)</a>
    <li><a href="#ref-for-sensor-type③⑤">10. Extensibility</a> <a href="#ref-for-sensor-type③⑥">(2)</a> <a href="#ref-for-sensor-type③⑦">(3)</a>
    <li><a href="#ref-for-sensor-type③⑧">10.5. When is Enabling Multiple Sensors of the Same Type Not the Right Choice?</a> <a href="#ref-for-sensor-type③⑨">(2)</a> <a href="#ref-for-sensor-type④⓪">(3)</a>
    <li><a href="#ref-for-sensor-type④①">10.6. Definition Requirements</a> <a href="#ref-for-sensor-type④②">(2)</a> <a href="#ref-for-sensor-type④③">(3)</a> <a href="#ref-for-sensor-type④④">(4)</a> <a href="#ref-for-sensor-type④⑤">(5)</a> <a href="#ref-for-sensor-type④⑥">(6)</a>
    <li><a href="#ref-for-sensor-type④⑦">10.8. Extending the Permission API</a>
    <li><a href="#ref-for-sensor-type④⑧">10.9. Extending the Feature Policy API</a> <a href="#ref-for-sensor-type④⑨">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="associated-sensors">
   <b><a href="#associated-sensors">#associated-sensors</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-associated-sensors">6.1. Sensor Type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="sensor-permission-names">
   <b><a href="#sensor-permission-names">#sensor-permission-names</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sensor-permission-names">5.6. Conditions to expose sensor readings</a>
    <li><a href="#ref-for-sensor-permission-names①">6.1. Sensor Type</a>
    <li><a href="#ref-for-sensor-permission-names②">8.15. Request sensor access</a>
    <li><a href="#ref-for-sensor-permission-names③">10.9. Extending the Feature Policy API</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="sensor-feature-names">
   <b><a href="#sensor-feature-names">#sensor-feature-names</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sensor-feature-names">8.2. Check sensor policy-controlled features</a> <a href="#ref-for-sensor-feature-names①">(2)</a>
    <li><a href="#ref-for-sensor-feature-names②">10.9. Extending the Feature Policy API</a> <a href="#ref-for-sensor-feature-names③">(2)</a> <a href="#ref-for-sensor-feature-names④">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="activated-sensor-objects">
   <b><a href="#activated-sensor-objects">#activated-sensor-objects</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-activated-sensor-objects">6.2. Sensor</a> <a href="#ref-for-activated-sensor-objects①">(2)</a> <a href="#ref-for-activated-sensor-objects②">(3)</a> <a href="#ref-for-activated-sensor-objects③">(4)</a> <a href="#ref-for-activated-sensor-objects④">(5)</a>
    <li><a href="#ref-for-activated-sensor-objects⑤">8.4. Activate a sensor object</a>
    <li><a href="#ref-for-activated-sensor-objects⑥">8.5. Deactivate a sensor object</a> <a href="#ref-for-activated-sensor-objects⑦">(2)</a>
    <li><a href="#ref-for-activated-sensor-objects⑧">8.6. Revoke sensor permission</a>
    <li><a href="#ref-for-activated-sensor-objects⑨">8.7. Set sensor settings</a>
    <li><a href="#ref-for-activated-sensor-objects①⓪">8.8. Update latest reading</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="latest-reading">
   <b><a href="#latest-reading">#latest-reading</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-latest-reading">6.2. Sensor</a> <a href="#ref-for-latest-reading①">(2)</a> <a href="#ref-for-latest-reading②">(3)</a> <a href="#ref-for-latest-reading③">(4)</a> <a href="#ref-for-latest-reading④">(5)</a> <a href="#ref-for-latest-reading⑤">(6)</a> <a href="#ref-for-latest-reading⑥">(7)</a>
    <li><a href="#ref-for-latest-reading⑦">8.7. Set sensor settings</a> <a href="#ref-for-latest-reading⑧">(2)</a>
    <li><a href="#ref-for-latest-reading⑨">8.8. Update latest reading</a> <a href="#ref-for-latest-reading①⓪">(2)</a>
    <li><a href="#ref-for-latest-reading①①">8.10. Report latest reading updated</a>
    <li><a href="#ref-for-latest-reading①②">8.11. Notify new reading</a>
    <li><a href="#ref-for-latest-reading①③">8.12. Notify activated state</a>
    <li><a href="#ref-for-latest-reading①④">8.14. Get value from latest reading</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="optimal-sampling-frequency">
   <b><a href="#optimal-sampling-frequency">#optimal-sampling-frequency</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-optimal-sampling-frequency">6.2. Sensor</a>
    <li><a href="#ref-for-optimal-sampling-frequency①">8.7. Set sensor settings</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="sensor">
   <b><a href="#sensor">#sensor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sensor">3. A note on Feature Detection of Hardware Features</a>
    <li><a href="#ref-for-sensor①">5.3. Default sensor</a>
    <li><a href="#ref-for-sensor②">5.5. Sampling Frequency and Reporting Frequency</a> <a href="#ref-for-sensor③">(2)</a>
    <li><a href="#ref-for-sensor④">5.6. Conditions to expose sensor readings</a>
    <li><a href="#ref-for-sensor⑤">6.2. Sensor</a> <a href="#ref-for-sensor⑥">(2)</a> <a href="#ref-for-sensor⑦">(3)</a> <a href="#ref-for-sensor⑧">(4)</a>
    <li><a href="#ref-for-sensor⑨">7.1. The Sensor Interface</a>
    <li><a href="#ref-for-sensor①⓪">7.1.1. Sensor lifecycle</a>
    <li><a href="#ref-for-sensor①①">7.1.2. Sensor garbage collection</a> <a href="#ref-for-sensor①②">(2)</a> <a href="#ref-for-sensor①③">(3)</a>
    <li><a href="#ref-for-sensor①④">7.1.3. Sensor internal slots</a> <a href="#ref-for-sensor①⑤">(2)</a> <a href="#ref-for-sensor①⑥">(3)</a> <a href="#ref-for-sensor①⑦">(4)</a>
    <li><a href="#ref-for-sensor①⑧">7.1.12. Event handlers</a>
    <li><a href="#ref-for-sensor①⑨">8.1. Initialize a sensor object</a> <a href="#ref-for-sensor②⓪">(2)</a>
    <li><a href="#ref-for-sensor②①">8.3. Connect to sensor</a>
    <li><a href="#ref-for-sensor②②">8.4. Activate a sensor object</a>
    <li><a href="#ref-for-sensor②③">8.5. Deactivate a sensor object</a>
    <li><a href="#ref-for-sensor②④">8.9. Find the reporting frequency of a sensor object</a>
    <li><a href="#ref-for-sensor②⑤">8.10. Report latest reading updated</a>
    <li><a href="#ref-for-sensor②⑥">8.11. Notify new reading</a>
    <li><a href="#ref-for-sensor②⑦">8.12. Notify activated state</a>
    <li><a href="#ref-for-sensor②⑧">8.13. Notify error</a>
    <li><a href="#ref-for-sensor②⑨">8.14. Get value from latest reading</a>
    <li><a href="#ref-for-sensor③⓪">8.15. Request sensor access</a>
    <li><a href="#ref-for-sensor③①">9.1. Mock Sensors</a> <a href="#ref-for-sensor③②">(2)</a> <a href="#ref-for-sensor③③">(3)</a>
    <li><a href="#ref-for-sensor③④">9.1.1. MockSensorConfiguration dictionary</a> <a href="#ref-for-sensor③⑤">(2)</a>
    <li><a href="#ref-for-sensor③⑥">9.1.3. Mock sensor type</a>
    <li><a href="#ref-for-sensor③⑦">9.2.1. Create mock sensor</a>
    <li><a href="#ref-for-sensor③⑧">10. Extensibility</a>
    <li><a href="#ref-for-sensor③⑨">10.2. Naming</a> <a href="#ref-for-sensor④⓪">(2)</a> <a href="#ref-for-sensor④①">(3)</a>
    <li><a href="#ref-for-sensor④②">10.5. When is Enabling Multiple Sensors of the Same Type Not the Right Choice?</a> <a href="#ref-for-sensor④③">(2)</a> <a href="#ref-for-sensor④④">(3)</a>
    <li><a href="#ref-for-sensor④⑤">10.6. Definition Requirements</a>
    <li><a href="#ref-for-sensor④⑥">10.8. Extending the Permission API</a> <a href="#ref-for-sensor④⑦">(2)</a>
    <li><a href="#ref-for-sensor④⑧">10.9. Extending the Feature Policy API</a> <a href="#ref-for-sensor④⑨">(2)</a> <a href="#ref-for-sensor⑤⓪">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensor-activated">
   <b><a href="#dom-sensor-activated">#dom-sensor-activated</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensor-activated">7.1.4. Sensor.activated</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensor-hasreading">
   <b><a href="#dom-sensor-hasreading">#dom-sensor-hasreading</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensor-hasreading">7.1.5. Sensor.hasReading</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensor-timestamp">
   <b><a href="#dom-sensor-timestamp">#dom-sensor-timestamp</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensor-timestamp">7.1.6. Sensor.timestamp</a>
    <li><a href="#ref-for-dom-sensor-timestamp①">8.1. Initialize a sensor object</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensor-start">
   <b><a href="#dom-sensor-start">#dom-sensor-start</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensor-start">7.1.7. Sensor.start()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensor-stop">
   <b><a href="#dom-sensor-stop">#dom-sensor-stop</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensor-stop">7.1.8. Sensor.stop()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensor-onreading">
   <b><a href="#dom-sensor-onreading">#dom-sensor-onreading</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensor-onreading">7.1.9. Sensor.onreading</a>
    <li><a href="#ref-for-dom-sensor-onreading①">10.5. When is Enabling Multiple Sensors of the Same Type Not the Right Choice?</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensor-onactivate">
   <b><a href="#dom-sensor-onactivate">#dom-sensor-onactivate</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensor-onactivate">7.1.10. Sensor.onactivate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensor-onerror">
   <b><a href="#dom-sensor-onerror">#dom-sensor-onerror</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensor-onerror">7.1.11. Sensor.onerror</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-sensoroptions">
   <b><a href="#dictdef-sensoroptions">#dictdef-sensoroptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-sensoroptions">7.1.3. Sensor internal slots</a>
    <li><a href="#ref-for-dictdef-sensoroptions①">10.6. Definition Requirements</a> <a href="#ref-for-dictdef-sensoroptions②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensoroptions-frequency">
   <b><a href="#dom-sensoroptions-frequency">#dom-sensoroptions-frequency</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensoroptions-frequency">7.1.3. Sensor internal slots</a>
    <li><a href="#ref-for-dom-sensoroptions-frequency①">8.1. Initialize a sensor object</a> <a href="#ref-for-dom-sensoroptions-frequency②">(2)</a> <a href="#ref-for-dom-sensoroptions-frequency③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="sensor-task-source">
   <b><a href="#sensor-task-source">#sensor-task-source</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sensor-task-source">8.5. Deactivate a sensor object</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensor-state-slot">
   <b><a href="#dom-sensor-state-slot">#dom-sensor-state-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensor-state-slot">7.1.2. Sensor garbage collection</a> <a href="#ref-for-dom-sensor-state-slot①">(2)</a> <a href="#ref-for-dom-sensor-state-slot②">(3)</a>
    <li><a href="#ref-for-dom-sensor-state-slot③">7.1.4. Sensor.activated</a>
    <li><a href="#ref-for-dom-sensor-state-slot④">7.1.7. Sensor.start()</a> <a href="#ref-for-dom-sensor-state-slot⑤">(2)</a>
    <li><a href="#ref-for-dom-sensor-state-slot⑥">7.1.8. Sensor.stop()</a> <a href="#ref-for-dom-sensor-state-slot⑦">(2)</a>
    <li><a href="#ref-for-dom-sensor-state-slot⑧">7.1.10. Sensor.onactivate</a>
    <li><a href="#ref-for-dom-sensor-state-slot⑨">8.12. Notify activated state</a>
    <li><a href="#ref-for-dom-sensor-state-slot①⓪">8.13. Notify error</a>
    <li><a href="#ref-for-dom-sensor-state-slot①①">8.14. Get value from latest reading</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensor-frequency-slot">
   <b><a href="#dom-sensor-frequency-slot">#dom-sensor-frequency-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensor-frequency-slot">6.2. Sensor</a> <a href="#ref-for-dom-sensor-frequency-slot①">(2)</a>
    <li><a href="#ref-for-dom-sensor-frequency-slot②">8.1. Initialize a sensor object</a>
    <li><a href="#ref-for-dom-sensor-frequency-slot③">8.9. Find the reporting frequency of a sensor object</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensor-lasteventfiredat-slot">
   <b><a href="#dom-sensor-lasteventfiredat-slot">#dom-sensor-lasteventfiredat-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensor-lasteventfiredat-slot">8.5. Deactivate a sensor object</a>
    <li><a href="#ref-for-dom-sensor-lasteventfiredat-slot①">8.10. Report latest reading updated</a>
    <li><a href="#ref-for-dom-sensor-lasteventfiredat-slot②">8.11. Notify new reading</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensor-pendingreadingnotification-slot">
   <b><a href="#dom-sensor-pendingreadingnotification-slot">#dom-sensor-pendingreadingnotification-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensor-pendingreadingnotification-slot">8.5. Deactivate a sensor object</a>
    <li><a href="#ref-for-dom-sensor-pendingreadingnotification-slot①">8.10. Report latest reading updated</a> <a href="#ref-for-dom-sensor-pendingreadingnotification-slot②">(2)</a> <a href="#ref-for-dom-sensor-pendingreadingnotification-slot③">(3)</a>
    <li><a href="#ref-for-dom-sensor-pendingreadingnotification-slot④">8.11. Notify new reading</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="sensorerrorevent">
   <b><a href="#sensorerrorevent">#sensorerrorevent</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sensorerrorevent">8.13. Notify error</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-sensorerrorevent-error">
   <b><a href="#dom-sensorerrorevent-error">#dom-sensorerrorevent-error</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-sensorerrorevent-error">8.13. Notify error</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-sensorerroreventinit">
   <b><a href="#dictdef-sensorerroreventinit">#dictdef-sensorerroreventinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-sensorerroreventinit">7.2. The SensorErrorEvent Interface</a>
    <li><a href="#ref-for-dictdef-sensorerroreventinit①">7.2.1. SensorErrorEvent.error</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="connect-to-sensor">
   <b><a href="#connect-to-sensor">#connect-to-sensor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-connect-to-sensor">7.1.7. Sensor.start()</a>
    <li><a href="#ref-for-connect-to-sensor①">9.1.1. MockSensorConfiguration dictionary</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="activate-a-sensor-object">
   <b><a href="#activate-a-sensor-object">#activate-a-sensor-object</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-activate-a-sensor-object">7.1.7. Sensor.start()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="deactivate-a-sensor-object">
   <b><a href="#deactivate-a-sensor-object">#deactivate-a-sensor-object</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-deactivate-a-sensor-object">7.1.2. Sensor garbage collection</a>
    <li><a href="#ref-for-deactivate-a-sensor-object①">7.1.8. Sensor.stop()</a>
    <li><a href="#ref-for-deactivate-a-sensor-object②">8.6. Revoke sensor permission</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="revoke-sensor-permission">
   <b><a href="#revoke-sensor-permission">#revoke-sensor-permission</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-revoke-sensor-permission">6.1. Sensor Type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="set-sensor-settings">
   <b><a href="#set-sensor-settings">#set-sensor-settings</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-set-sensor-settings">8.4. Activate a sensor object</a>
    <li><a href="#ref-for-set-sensor-settings①">8.5. Deactivate a sensor object</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="update-latest-reading">
   <b><a href="#update-latest-reading">#update-latest-reading</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-update-latest-reading">6.2. Sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="find-the-reporting-frequency-of-a-sensor-object">
   <b><a href="#find-the-reporting-frequency-of-a-sensor-object">#find-the-reporting-frequency-of-a-sensor-object</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-find-the-reporting-frequency-of-a-sensor-object">8.10. Report latest reading updated</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="report-latest-reading-updated">
   <b><a href="#report-latest-reading-updated">#report-latest-reading-updated</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-report-latest-reading-updated">8.8. Update latest reading</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="notify-new-reading">
   <b><a href="#notify-new-reading">#notify-new-reading</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-notify-new-reading">8.10. Report latest reading updated</a> <a href="#ref-for-notify-new-reading①">(2)</a> <a href="#ref-for-notify-new-reading②">(3)</a> <a href="#ref-for-notify-new-reading③">(4)</a>
    <li><a href="#ref-for-notify-new-reading④">8.12. Notify activated state</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="notify-activated-state">
   <b><a href="#notify-activated-state">#notify-activated-state</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-notify-activated-state">8.4. Activate a sensor object</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="notify-error">
   <b><a href="#notify-error">#notify-error</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-notify-error">7.1.7. Sensor.start()</a> <a href="#ref-for-notify-error①">(2)</a>
    <li><a href="#ref-for-notify-error②">8.6. Revoke sensor permission</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="get-value-from-latest-reading">
   <b><a href="#get-value-from-latest-reading">#get-value-from-latest-reading</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-get-value-from-latest-reading">6.2. Sensor</a>
    <li><a href="#ref-for-get-value-from-latest-reading①">7.1.5. Sensor.hasReading</a>
    <li><a href="#ref-for-get-value-from-latest-reading②">7.1.6. Sensor.timestamp</a>
    <li><a href="#ref-for-get-value-from-latest-reading③">10.6. Definition Requirements</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="request-sensor-access">
   <b><a href="#request-sensor-access">#request-sensor-access</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-request-sensor-access">7.1.7. Sensor.start()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="mock-sensor">
   <b><a href="#mock-sensor">#mock-sensor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mock-sensor">9. Automation</a>
    <li><a href="#ref-for-mock-sensor①">9.1. Mock Sensors</a> <a href="#ref-for-mock-sensor②">(2)</a> <a href="#ref-for-mock-sensor③">(3)</a> <a href="#ref-for-mock-sensor④">(4)</a> <a href="#ref-for-mock-sensor⑤">(5)</a> <a href="#ref-for-mock-sensor⑥">(6)</a> <a href="#ref-for-mock-sensor⑦">(7)</a> <a href="#ref-for-mock-sensor⑧">(8)</a>
    <li><a href="#ref-for-mock-sensor⑨">9.1.1. MockSensorConfiguration dictionary</a> <a href="#ref-for-mock-sensor①⓪">(2)</a> <a href="#ref-for-mock-sensor①①">(3)</a> <a href="#ref-for-mock-sensor①②">(4)</a> <a href="#ref-for-mock-sensor①③">(5)</a>
    <li><a href="#ref-for-mock-sensor①④">9.1.2. MockSensor dictionary</a> <a href="#ref-for-mock-sensor①⑤">(2)</a> <a href="#ref-for-mock-sensor①⑥">(3)</a> <a href="#ref-for-mock-sensor①⑦">(4)</a> <a href="#ref-for-mock-sensor①⑧">(5)</a> <a href="#ref-for-mock-sensor①⑨">(6)</a>
    <li><a href="#ref-for-mock-sensor②⓪">9.2.1. Create mock sensor</a> <a href="#ref-for-mock-sensor②①">(2)</a> <a href="#ref-for-mock-sensor②②">(3)</a> <a href="#ref-for-mock-sensor②③">(4)</a> <a href="#ref-for-mock-sensor②④">(5)</a>
    <li><a href="#ref-for-mock-sensor②⑤">9.2.2. Get mock sensor</a> <a href="#ref-for-mock-sensor②⑥">(2)</a>
    <li><a href="#ref-for-mock-sensor②⑦">9.2.3. Update mock sensor reading</a> <a href="#ref-for-mock-sensor②⑧">(2)</a>
    <li><a href="#ref-for-mock-sensor②⑨">9.2.4. Delete mock sensor</a> <a href="#ref-for-mock-sensor③⓪">(2)</a> <a href="#ref-for-mock-sensor③①">(3)</a>
    <li><a href="#ref-for-mock-sensor③②">9.3. Handling errors</a> <a href="#ref-for-mock-sensor③③">(2)</a> <a href="#ref-for-mock-sensor③④">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="mock-sensor-reading">
   <b><a href="#mock-sensor-reading">#mock-sensor-reading</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mock-sensor-reading">9.1. Mock Sensors</a> <a href="#ref-for-mock-sensor-reading①">(2)</a> <a href="#ref-for-mock-sensor-reading②">(3)</a> <a href="#ref-for-mock-sensor-reading③">(4)</a> <a href="#ref-for-mock-sensor-reading④">(5)</a> <a href="#ref-for-mock-sensor-reading⑤">(6)</a>
    <li><a href="#ref-for-mock-sensor-reading⑥">9.1.3. Mock sensor type</a>
    <li><a href="#ref-for-mock-sensor-reading⑦">9.2.3. Update mock sensor reading</a> <a href="#ref-for-mock-sensor-reading⑧">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-mocksensorconfiguration">
   <b><a href="#dictdef-mocksensorconfiguration">#dictdef-mocksensorconfiguration</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-mocksensorconfiguration">9.1.1. MockSensorConfiguration dictionary</a>
    <li><a href="#ref-for-dictdef-mocksensorconfiguration①">9.2.1. Create mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensorconfiguration-mocksensortype">
   <b><a href="#dom-mocksensorconfiguration-mocksensortype">#dom-mocksensorconfiguration-mocksensortype</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensorconfiguration-mocksensortype">9.1.1. MockSensorConfiguration dictionary</a>
    <li><a href="#ref-for-dom-mocksensorconfiguration-mocksensortype①">9.2.1. Create mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensorconfiguration-connected">
   <b><a href="#dom-mocksensorconfiguration-connected">#dom-mocksensorconfiguration-connected</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensorconfiguration-connected">9.1.1. MockSensorConfiguration dictionary</a>
    <li><a href="#ref-for-dom-mocksensorconfiguration-connected①">9.2.1. Create mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensorconfiguration-maxsamplingfrequency">
   <b><a href="#dom-mocksensorconfiguration-maxsamplingfrequency">#dom-mocksensorconfiguration-maxsamplingfrequency</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensorconfiguration-maxsamplingfrequency">9.1.1. MockSensorConfiguration dictionary</a>
    <li><a href="#ref-for-dom-mocksensorconfiguration-maxsamplingfrequency①">9.2.1. Create mock sensor</a> <a href="#ref-for-dom-mocksensorconfiguration-maxsamplingfrequency②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensorconfiguration-minsamplingfrequency">
   <b><a href="#dom-mocksensorconfiguration-minsamplingfrequency">#dom-mocksensorconfiguration-minsamplingfrequency</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensorconfiguration-minsamplingfrequency">9.1.1. MockSensorConfiguration dictionary</a>
    <li><a href="#ref-for-dom-mocksensorconfiguration-minsamplingfrequency①">9.2.1. Create mock sensor</a> <a href="#ref-for-dom-mocksensorconfiguration-minsamplingfrequency②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="connection-flag">
   <b><a href="#connection-flag">#connection-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-connection-flag">9.2.1. Create mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-mocksensor">
   <b><a href="#dictdef-mocksensor">#dictdef-mocksensor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-mocksensor">9.1.2. MockSensor dictionary</a> <a href="#ref-for-dictdef-mocksensor①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensor-maxsamplingfrequency">
   <b><a href="#dom-mocksensor-maxsamplingfrequency">#dom-mocksensor-maxsamplingfrequency</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensor-maxsamplingfrequency">9.1.2. MockSensor dictionary</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensor-minsamplingfrequency">
   <b><a href="#dom-mocksensor-minsamplingfrequency">#dom-mocksensor-minsamplingfrequency</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensor-minsamplingfrequency">9.1.2. MockSensor dictionary</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensor-requestedsamplingfrequency">
   <b><a href="#dom-mocksensor-requestedsamplingfrequency">#dom-mocksensor-requestedsamplingfrequency</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensor-requestedsamplingfrequency">9.1.2. MockSensor dictionary</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="serialized-mock-sensor">
   <b><a href="#serialized-mock-sensor">#serialized-mock-sensor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serialized-mock-sensor">9.2.2. Get mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="mock-sensor-type">
   <b><a href="#mock-sensor-type">#mock-sensor-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mock-sensor-type">9.1. Mock Sensors</a>
    <li><a href="#ref-for-mock-sensor-type①">9.1.1. MockSensorConfiguration dictionary</a>
    <li><a href="#ref-for-mock-sensor-type②">9.1.3. Mock sensor type</a> <a href="#ref-for-mock-sensor-type③">(2)</a> <a href="#ref-for-mock-sensor-type④">(3)</a> <a href="#ref-for-mock-sensor-type⑤">(4)</a> <a href="#ref-for-mock-sensor-type⑥">(5)</a> <a href="#ref-for-mock-sensor-type⑦">(6)</a> <a href="#ref-for-mock-sensor-type⑧">(7)</a> <a href="#ref-for-mock-sensor-type⑨">(8)</a> <a href="#ref-for-mock-sensor-type①⓪">(9)</a> <a href="#ref-for-mock-sensor-type①①">(10)</a> <a href="#ref-for-mock-sensor-type①②">(11)</a> <a href="#ref-for-mock-sensor-type①③">(12)</a> <a href="#ref-for-mock-sensor-type①④">(13)</a> <a href="#ref-for-mock-sensor-type①⑤">(14)</a>
    <li><a href="#ref-for-mock-sensor-type①⑥">9.2.1. Create mock sensor</a> <a href="#ref-for-mock-sensor-type①⑦">(2)</a>
    <li><a href="#ref-for-mock-sensor-type①⑧">9.2.2. Get mock sensor</a>
    <li><a href="#ref-for-mock-sensor-type①⑨">9.2.3. Update mock sensor reading</a>
    <li><a href="#ref-for-mock-sensor-type②⓪">9.2.4. Delete mock sensor</a>
    <li><a href="#ref-for-mock-sensor-type②①">10.7. Automation</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="enumdef-mocksensortype">
   <b><a href="#enumdef-mocksensortype">#enumdef-mocksensortype</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-mocksensortype">9.1.1. MockSensorConfiguration dictionary</a> <a href="#ref-for-enumdef-mocksensortype①">(2)</a>
    <li><a href="#ref-for-enumdef-mocksensortype②">9.1.3. Mock sensor type</a>
    <li><a href="#ref-for-enumdef-mocksensortype③">9.2.2. Get mock sensor</a>
    <li><a href="#ref-for-enumdef-mocksensortype④">9.2.3. Update mock sensor reading</a>
    <li><a href="#ref-for-enumdef-mocksensortype⑤">9.2.4. Delete mock sensor</a>
    <li><a href="#ref-for-enumdef-mocksensortype⑥">10.7. Automation</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensortype-ambient-light">
   <b><a href="#dom-mocksensortype-ambient-light">#dom-mocksensortype-ambient-light</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensortype-ambient-light">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensortype-accelerometer">
   <b><a href="#dom-mocksensortype-accelerometer">#dom-mocksensortype-accelerometer</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensortype-accelerometer">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensortype-linear-acceleration">
   <b><a href="#dom-mocksensortype-linear-acceleration">#dom-mocksensortype-linear-acceleration</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensortype-linear-acceleration">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensortype-gravity">
   <b><a href="#dom-mocksensortype-gravity">#dom-mocksensortype-gravity</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensortype-gravity">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensortype-gyroscope">
   <b><a href="#dom-mocksensortype-gyroscope">#dom-mocksensortype-gyroscope</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensortype-gyroscope">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensortype-magnetometer">
   <b><a href="#dom-mocksensortype-magnetometer">#dom-mocksensortype-magnetometer</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensortype-magnetometer">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensortype-uncalibrated-magnetometer">
   <b><a href="#dom-mocksensortype-uncalibrated-magnetometer">#dom-mocksensortype-uncalibrated-magnetometer</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensortype-uncalibrated-magnetometer">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensortype-absolute-orientation">
   <b><a href="#dom-mocksensortype-absolute-orientation">#dom-mocksensortype-absolute-orientation</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensortype-absolute-orientation">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensortype-relative-orientation">
   <b><a href="#dom-mocksensortype-relative-orientation">#dom-mocksensortype-relative-orientation</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensortype-relative-orientation">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensortype-geolocation">
   <b><a href="#dom-mocksensortype-geolocation">#dom-mocksensortype-geolocation</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensortype-geolocation">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-mocksensortype-proximity">
   <b><a href="#dom-mocksensortype-proximity">#dom-mocksensortype-proximity</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mocksensortype-proximity">9.1.3. Mock sensor type</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="mock-sensor-reading-values">
   <b><a href="#mock-sensor-reading-values">#mock-sensor-reading-values</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mock-sensor-reading-values">9.1.3. Mock sensor type</a>
    <li><a href="#ref-for-mock-sensor-reading-values①">10.7. Automation</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-mocksensorreadingvalues">
   <b><a href="#dictdef-mocksensorreadingvalues">#dictdef-mocksensorreadingvalues</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-mocksensorreadingvalues">9.1. Mock Sensors</a>
    <li><a href="#ref-for-dictdef-mocksensorreadingvalues①">9.1.3. Mock sensor type</a> <a href="#ref-for-dictdef-mocksensorreadingvalues②">(2)</a>
    <li><a href="#ref-for-dictdef-mocksensorreadingvalues③">9.2.3. Update mock sensor reading</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="no-such-mock-sensor">
   <b><a href="#no-such-mock-sensor">#no-such-mock-sensor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-no-such-mock-sensor">9.2.2. Get mock sensor</a>
    <li><a href="#ref-for-no-such-mock-sensor①">9.2.3. Update mock sensor reading</a>
    <li><a href="#ref-for-no-such-mock-sensor②">9.2.4. Delete mock sensor</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="mock-sensor-already-created">
   <b><a href="#mock-sensor-already-created">#mock-sensor-already-created</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mock-sensor-already-created">9.2.1. Create mock sensor</a> <a href="#ref-for-mock-sensor-already-created①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extension-specification">
   <b><a href="#extension-specification">#extension-specification</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extension-specification">4.2.1. Secure Context</a>
    <li><a href="#ref-for-extension-specification①">5.6. Conditions to expose sensor readings</a>
    <li><a href="#ref-for-extension-specification②">8.14. Get value from latest reading</a>
    <li><a href="#ref-for-extension-specification③">9. Automation</a>
    <li><a href="#ref-for-extension-specification④">9.1.3. Mock sensor type</a>
    <li><a href="#ref-for-extension-specification⑤">10. Extensibility</a> <a href="#ref-for-extension-specification⑥">(2)</a> <a href="#ref-for-extension-specification⑦">(3)</a> <a href="#ref-for-extension-specification⑧">(4)</a>
    <li><a href="#ref-for-extension-specification⑨">10.1. Security and Privacy</a>
    <li><a href="#ref-for-extension-specification①⓪">10.3. Unit</a>
    <li><a href="#ref-for-extension-specification①①">10.4. Exposing High-Level vs. Low-Level Sensors</a>
    <li><a href="#ref-for-extension-specification①②">10.5. When is Enabling Multiple Sensors of the Same Type Not the Right Choice?</a>
    <li><a href="#ref-for-extension-specification①③">10.6. Definition Requirements</a> <a href="#ref-for-extension-specification①④">(2)</a> <a href="#ref-for-extension-specification①⑤">(3)</a> <a href="#ref-for-extension-specification①⑥">(4)</a>
    <li><a href="#ref-for-extension-specification①⑦">10.7. Automation</a>
    <li><a href="#ref-for-extension-specification①⑧">10.9. Extending the Feature Policy API</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extension-sensor-interface">
   <b><a href="#extension-sensor-interface">#extension-sensor-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extension-sensor-interface">6.1. Sensor Type</a>
    <li><a href="#ref-for-extension-sensor-interface①">6.2. Sensor</a> <a href="#ref-for-extension-sensor-interface②">(2)</a>
    <li><a href="#ref-for-extension-sensor-interface③">9.1.3. Mock sensor type</a>
    <li><a href="#ref-for-extension-sensor-interface④">10.6. Definition Requirements</a> <a href="#ref-for-extension-sensor-interface⑤">(2)</a> <a href="#ref-for-extension-sensor-interface⑥">(3)</a> <a href="#ref-for-extension-sensor-interface⑦">(4)</a>
    <li><a href="#ref-for-extension-sensor-interface⑧">10.7. Automation</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="supported-sensor-options">
   <b><a href="#supported-sensor-options">#supported-sensor-options</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-supported-sensor-options">8.1. Initialize a sensor object</a>
    <li><a href="#ref-for-supported-sensor-options①">10.6. Definition Requirements</a> <a href="#ref-for-supported-sensor-options②">(2)</a>
   </ul>
  </aside>
<script>/* script-var-click-highlighting */

    document.addEventListener("click", e=>{
        if(e.target.nodeName == "VAR") {
            highlightSameAlgoVars(e.target);
        }
    });
    {
        const indexCounts = new Map();
        const indexNames = new Map();
        function highlightSameAlgoVars(v) {
            // Find the algorithm container.
            let algoContainer = null;
            let searchEl = v;
            while(algoContainer == null && searchEl != document.body) {
                searchEl = searchEl.parentNode;
                if(searchEl.hasAttribute("data-algorithm")) {
                    algoContainer = searchEl;
                }
            }

            // Not highlighting document-global vars,
            // too likely to be unrelated.
            if(algoContainer == null) return;

            const algoName = algoContainer.getAttribute("data-algorithm");
            const varName = getVarName(v);
            const addClass = !v.classList.contains("selected");
            let highlightClass = null;
            if(addClass) {
                const index = chooseHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] += 1;
                indexNames.set(algoName+"///"+varName, index);
                highlightClass = nameFromIndex(index);
            } else {
                const index = previousHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] -= 1;
                highlightClass = nameFromIndex(index);
            }

            // Find all same-name vars, and toggle their class appropriately.
            for(const el of algoContainer.querySelectorAll("var")) {
                if(getVarName(el) == varName) {
                    el.classList.toggle("selected", addClass);
                    el.classList.toggle(highlightClass, addClass);
                }
            }
        }
        function getVarName(el) {
            return el.textContent.replace(/(\s| )+/, " ").trim();
        }
        function chooseHighlightIndex(algoName, varName) {
            let indexes = null;
            if(indexCounts.has(algoName)) {
                indexes = indexCounts.get(algoName);
            } else {
                // 7 classes right now
                indexes = [0,0,0,0,0,0,0];
                indexCounts.set(algoName, indexes);
            }

            // If the element was recently unclicked,
            // *and* that color is still unclaimed,
            // give it back the same color.
            const lastIndex = previousHighlightIndex(algoName, varName);
            if(indexes[lastIndex] === 0) return lastIndex;

            // Find the earliest index with the lowest count.
            const minCount = Math.min.apply(null, indexes);
            let index = null;
            for(var i = 0; i < indexes.length; i++) {
                if(indexes[i] == minCount) {
                    return i;
                }
            }
        }
        function previousHighlightIndex(algoName, varName) {
            return indexNames.get(algoName+"///"+varName);
        }
        function nameFromIndex(index) {
            return "selected" + index;
        }
    }
    </script>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>